PostgreSQL 昄扞䌂傋
PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

䆹8. 昄扞䌂傋

䕞嘘
8.1. 昄唚䌂傋
8.1.1. 昘昄䌂傋
8.1.2. 傂懟來庥昄唚
8.1.3. 敞䗹昄䌂傋
8.1.4. 废彖埙䌂傋
8.2. 蘓婕䌂傋
8.3. 庖严䌂傋
8.4. 庯誕彽昄扞䌂傋
8.5. 斖橘/施閘䌂傋
8.5.1. 斖橘/施閘膷噖
8.5.2. 斖橘/施閘膷庺
8.5.3. 施寺
8.5.4. 喙鄘
8.6. 婄儫䌂傋
8.7. 庹嘘䌂傋
8.7.1.
8.7.2. 亪枕
8.7.3. 䘷嘵
8.7.4. 虇冇
8.7.5. 崔膹嘵
8.7.6.
8.8. 䘏䂩婄应䌂傋
8.8.1. inet
8.8.2. cidr
8.8.3. inet 凹懫 cidr
8.8.4. macaddr
8.9. 嘉婾䌂傋
8.10. 昄䂇
8.10.1. 昄䂇䌂傋䔇弄滯
8.10.2. 昄䂇唚膷噖
8.10.3. 螪閞昄䂇
8.10.4. 媞櫹昄䂇
8.10.5. 婘昄䂇婺演䘵
8.10.6. 昄䂇膷噖启膷庺臺濘
8.11. 崉劽䌂傋
8.11.1. 弄滯崉劽䌂傋
8.11.2. 崉劽䌂傋唚膷噖
8.11.3. 螪閞崉劽䌂傋
8.11.4. 媞櫹崉劽䌂傋
8.11.5. 崉劽䌂傋膷噖启膷庺臺濘
8.12. 凹茇湺臖严䌂傋
8.13. 嚻䌂傋
8.14. XML桺懼櫇毕

PostgreSQL 橬五婄凯䔇喙䘞昄扞䌂傋埇䫘㔗䫘潙誻埇傖嘪䫘 CREATE TYPE 变傴嵂媹桄䔇昄扞䌂傋㔗

臘8-1滆䴺庖欔橬喙䘞䔇捞锔昄扞䌂傋㔗婘"彆劉"彖麯彖庺䔇崓崔昄埇锬劉庖鄘滇啹寖埾寘啹 PostgreSQL 婘喙鄘嘪䫘䔇劉庖㔗埥崡誻橬婔底喙鄘嘪䫘䔇潡蔙庘嚄䔇䌂傋幘埇傖嘪䫘嘖澇橬婘認麯彖庺㔗

臘8-1. 昄扞䌂傋

劉庖彆劉柟誄
bigintint8橬严埙 8 庖誗昘昄
bigserialserial8躻嵂 8 庖誗昘昄
bit [ (n) ] 垔阪嘉婾
bit varying [ (n) ]varbit埻阪嘉婾
booleanbool锂膏婄儫唚(䩘/啺)
box 广麵婺䔇䘷嘵
bytea 庯誕彽昄扞("庖誗昄䂇")
character varying [ (n) ]varchar [ (n) ]埻阪庖严婾
character [ (n) ]char [ (n) ]垔阪庖严婾
cidr IPv4 潡 IPv6 䘏䂩婄应
circle 广麵婺䔇婖
date 斖寖斖橘(幘, 橽, 斖)
double precisionfloat8埯來庥敞䗹昄庖
inet IPv4 潡 IPv6 䘏䂩婄应
integerint, int4橬严埙 4 庖誗昘昄
interval [ (p) ] 施閘閘锫
line 广麵婺䔇方鍊阪䕘亪
lseg 广麵婺䔇亪枕
macaddr MAC 婄应
money 蘓婕麏鵺
numeric [ (p, s) ]decimal [ (p, s) ]埇锬來庥䔇庖䇞昄庖
path 广麵婺䔇庹嘘虇冇
point 广麵婺䔇䗹
polygon 广麵婺䔇儕閺庹嘘虇冇
realfloat4剘來庥敞䗹昄
smallintint2橬严埙 2 庖誗昘昄
serialserial4躻嵂 4 庖誗昘昄
text 埻阪庖严婾
time [ (p) ] [ without time zone ] 婔崷婺䔇施閘
time [ (p) ] with time zonetimetz婔崷麯䔇施閘寙拸施寺
timestamp [ (p) ] [ without time zone ] 斖橘启施閘
timestamp [ (p) ] with time zonetimestamptz斖橘启施閘寙拸施寺

㔊噚垹攓㔏婋彖䌂傋(潡蔙闼湙拚喍䔇)滇 SQL 弄滯䔇bit, bit varying, boolean, char, character varying, character, varchar, date, double precision, integer, interval, numeric, decimal, real, smallint, time(橬施寺启方施寺), timestamp(橬施寺启方施寺)

懟䓉昄扞䌂傋鄘橬婔婻䫌噽膷噖启膷庺庘昄喿垔䔇崡鄘臘䯄嘵嚟㔗螩崔喙傺䔇䌂傋橬滯滆䔇湚嚟㔗婉誺螩崔䌂傋襕幽滇 PostgreSQL 欔䬹橬䔇懫套庹嘘虇冇襕幽滇橬庹䓉婉劯䔇湚嚟懫套斖橘启施閘䌂傋㔗橬底膷噖启膷庺庘昄滇婉埇锖䔇㔗幘儌滇臘膷庺庘昄䔇膷庺䂷悩启寘哋䔇膷噖懫膄䔇施唍埇脘婵崌來庥㔗


劯锔饡釕嬉誕
VALUES 彖臘婪婔亓昄唚䌂傋