postgresql数据类型对比说明

sql standardsqlserverpostgresqlpostgresqldescription
aliases
bigintbigintbigintint8signed eight-byte integer:有符号8字节整数
  bigserialserial8autoincrementing eight-byte integer:自增属性的 bigint
bitbinarybit [ (n) ] fixed-length bit string:定长位串
bit varyingvarbinarybit varying [ (n) ]varbitvariable-length bit string:变长位串
booleanbitbooleanboollogical boolean (true/false):布尔值
 
box
rectangular box on a plane


bytea
binary data ("byte array")
character varyingvarcharcharacter varying [ (n) ]varchar [ (n) ]variable-length character string:变长字符串(长度有限制)
varchar
charactercharcharacter [ (n) ]char [ (n) ]fixed-length character string:定长字符串
char
  cidr
ipv4 or ipv6 network address


circle
circle on a plane
datedatedate calendar date (year, month, day):日期(仅)
double precisionfloat()double precisionfloat8double precision floating-point number (8 bytes):双精度8字节浮点数
  inet
ipv4 or ipv6 host address
integerintintegerint, int4signed four-byte integer:有符号4字节整数【一般意义上的整数】
inteval interval [ fields ] [ (p) ] time span:时间间隔值
  line
infinite line on a plane


lseg
line segment on a plane


macaddr
mac (media access control) address

moneymoney
currency amount
numericnumericnumeric [ (p, s) ]decimal [ (p, s) ]exact numeric of selectable precision:高精度定点数
decimaldecimal
  path
geometric path on a plane


point
geometric point on a plane


polygon
closed geometric path on a plane
realrealrealfloat4single precision floating-point number (4 bytes):单精度4字节浮点数
float()
smallintsmallintsmallintint2signed two-byte integer:小整数
 
smallserialserial2autoincrementing two-byte integer:自增属性的smallint


serialserial4autoincrementing four-byte integer:自增属性的int
 texttext variable-length character string:变长大字符串(长度足够大)
varchar(max)
time without time zonetimetime [ (p) ] [ without time zone ] time of day (no time zone):一天内的时间值,无时区
time with time zone time [ (p) ] with time zonetimetztime of day, including time zone:一天内的时间值,有时区
timestamp without time zonedatetimetimestamp [ (p) ] [ without time zone ] date and time (no time zone):日期时间,无时区
datetime2
timestamp with time zonedatetimeoffsettimestamp [ (p) ] with time zonetimestamptzdate and time, including time zone:日期时间,有时区
 
tsquery
text search query


tsvector
text search document


txid_snapshot
user-level transaction id snapshot
 uniqueidentifieruuid universally unique identifier:唯一标识类型
xmlxmlxml xml data:xml数据类型
  json json data

  • 5
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值