跳到主要内容

数据类型

2025年02月25日
柏拉文
越努力,越幸运

一、bigint


bigint int8 signed eight-byte integer

二、bigserial


bigserial serial8 autoincrementing eight-byte integer

三、bit [ (n) ]


bit [ (n) ] fixed-length bit string

四、bit varying [ (n) ]


bit varying [ (n) ] varbit [ (n) ] variable-length bit string

五、boolean


boolean bool logical Boolean (true/false)

六、box


box rectangular box on a plane

七、bytea


bytea binary data (“byte array”)

八、character [ (n) ]


character [ (n) ] char [ (n) ] fixed-length character string

九、character varying [ (n) ]


character varying [ (n) ] varchar [ (n) ] variable-length character string

十、cidr


cidr IPv4 or IPv6 network address

十一、circle


circle circle on a plane

十二、date


date calendar date (year, month, day)

十三、double precision


double precision float8 double precision floating-point number (8 bytes)

十四、inet


inet IPv4 or IPv6 host address

十五、integer


integer int, int4 signed four-byte integer

十六、interval [ fields ] [ (p) ]


interval [ fields ] [ (p) ] time span

十七、json


json textual JSON data

十八、jsonb


jsonb binary JSON data, decomposed

十九、line


line infinite line on a plane

二十、lseg


lseg line segment on a plane

二十一、macaddr


macaddr MAC (Media Access Control) address

二十二、macaddr8


macaddr8 MAC (Media Access Control) address (EUI-64 format)

二十三、money


money currency amount

二十四、numeric [ (p, s) ]


numeric [ (p, s) ] decimal [ (p, s) ] exact numeric of selectable precision

二十五、path


path geometric path on a plane

二十六、pg_lsn


pg_lsn PostgreSQL Log Sequence Number

二十七、pg_snapshot


pg_snapshot user-level transaction ID snapshot

二十八、point


point geometric point on a plane

二十九、polygon


polygon closed geometric path on a plane

三十、real


real float4 single precision floating-point number (4 bytes)

三十一、smallint


smallint int2 signed two-byte integer

三十二、smallserial


smallserial serial2 autoincrementing two-byte integer

三十三、serial


serial serial4 autoincrementing four-byte integer

三十四、text


text variable-length character string

三十五、time [ (p) ] [ without time zone ]


time [ (p) ] [ without time zone ] time of day (no time zone)

三十六、time [ (p) ] with time zone


time [ (p) ] with time zone timetz time of day, including time zone

三十七、timestamp [ (p) ] [ without time zone ]


timestamp [ (p) ] [ without time zone ] date and time (no time zone)

三十八、timestamp [ (p) ] with time zone


timestamp [ (p) ] with time zone timestamptz date and time, including time zone

三十九、tsquery


tsquery text search query

四十、tsvector


tsvector text search document

四十一、txid_snapshot


txid_snapshot user-level transaction ID snapshot (deprecated; see pg_snapshot)

四十二、uuid


uuid universally unique identifier

四十三、xml


xml XML data