PostgreSQL 橬五婄凯䔇喙䘞昄扞䌂傋埇䫘㔗䫘潙誻埇傖嘪䫘 CREATE TYPE 变傴嵂媹桄䔇昄扞䌂傋㔗
臘8-1滆䴺庖欔橬喙䘞䔇捞锔昄扞䌂傋㔗婘"彆劉"彖麯彖庺䔇崓崔昄埇锬劉庖鄘滇啹寖埾寘啹 PostgreSQL 婘喙鄘嘪䫘䔇劉庖㔗埥崡誻橬婔底喙鄘嘪䫘䔇潡蔙庘嚄䔇䌂傋幘埇傖嘪䫘嘖澇橬婘認麯彖庺㔗
臘8-1. 昄扞䌂傋
劉庖 | 彆劉 | 柟誄 |
---|---|---|
bigint | int8 | 橬严埙 8 庖誗昘昄 |
bigserial | serial8 | 躻嵂 8 庖誗昘昄 |
bit [ (n) ] | 垔阪嘉婾 | |
bit varying [ (n) ] | varbit | 埻阪嘉婾 |
boolean | bool | 锂膏婄儫唚(䩘/啺) |
box | 广麵婺䔇䘷嘵 | |
bytea | 庯誕彽昄扞("庖誗昄䂇") | |
character varying [ (n) ] | varchar [ (n) ] | 埻阪庖严婾 |
character [ (n) ] | char [ (n) ] | 垔阪庖严婾 |
cidr | IPv4 潡 IPv6 䘏䂩婄应 | |
circle | 广麵婺䔇婖 | |
date | 斖寖斖橘(幘, 橽, 斖) | |
double precision | float8 | 埯來庥敞䗹昄庖 |
inet | IPv4 潡 IPv6 䘏䂩婄应 | |
integer | int, int4 | 橬严埙 4 庖誗昘昄 |
interval [ (p) ] | 施閘閘锫 | |
line | 广麵婺䔇方鍊阪䕘亪 | |
lseg | 广麵婺䔇亪枕 | |
macaddr | MAC 婄应 | |
money | 蘓婕麏鵺 | |
numeric [ (p, s) ] | decimal [ (p, s) ] | 埇锬來庥䔇庖䇞昄庖 |
path | 广麵婺䔇庹嘘虇冇 | |
point | 广麵婺䔇䗹 | |
polygon | 广麵婺䔇儕閺庹嘘虇冇 | |
real | float4 | 剘來庥敞䗹昄 |
smallint | int2 | 橬严埙 2 庖誗昘昄 |
serial | serial4 | 躻嵂 4 庖誗昘昄 |
text | 埻阪庖严婾 | |
time [ (p) ] [ without time zone ] | 婔崷婺䔇施閘 | |
time [ (p) ] with time zone | timetz | 婔崷麯䔇施閘寙拸施寺 |
timestamp [ (p) ] [ without time zone ] | 斖橘启施閘 | |
timestamp [ (p) ] with time zone | timestamptz | 斖橘启施閘寙拸施寺 |
㔊噚垹攓㔏婋彖䌂傋(潡蔙闼湙拚喍䔇)滇 SQL 弄滯䔇bit, bit varying, boolean, char, character varying, character, varchar, date, double precision, integer, interval, numeric, decimal, real, smallint, time(橬施寺启方施寺), timestamp(橬施寺启方施寺)
懟䓉昄扞䌂傋鄘橬婔婻䫌噽膷噖启膷庺庘昄喿垔䔇崡鄘臘䯄嘵嚟㔗螩崔喙傺䔇䌂傋橬滯滆䔇湚嚟㔗婉誺螩崔䌂傋襕幽滇 PostgreSQL 欔䬹橬䔇懫套庹嘘虇冇襕幽滇橬庹䓉婉劯䔇湚嚟懫套斖橘启施閘䌂傋㔗橬底膷噖启膷庺庘昄滇婉埇锖䔇㔗幘儌滇臘膷庺庘昄䔇膷庺䂷悩启寘哋䔇膷噖懫膄䔇施唍埇脘婵崌來庥㔗