Tipe Data Yang Didikung PostgreSQL

Untuk melihat tipe data yang didikung PostgreSQL, maka dapat menulis perintah berikut ini pada console PostgreSQL.

postgres=# \dT

List of data types
————————————————————————-
Schema | Name | Description
————+——————+—————————————–
pg_catalog | “any” |
pg_catalog | “char” | single character
pg_catalog | “trigger” |
pg_catalog | “unknown” |
pg_catalog | abstime | absolute, limited-range date and time
pg_catalog | aclitem | access control list
pg_catalog | anyarray |
pg_catalog | anyelement |
pg_catalog | bigint | ~18 digit integer, 8-byte storage
pg_catalog | bit | fixed-length bit string
pg_catalog | bit varying | variable-length bit string
pg_catalog | boolean | boolean, ‘true’/'false’
pg_catalog | box | geometric box ‘(lower left,upper right)’
pg_catalog | bytea | variable-length string, binary values

pg_catalog | character | char(length), blank-padded string, fixed storage length
pg_catalog | character varying| varchar(length), non-blank-padded string, variable storage length
pg_catalog | cid | command identifier type, sequence intransaction id
pg_catalog | cidr | networkIP address/netmask,networkaddress
pg_catalog | circle | geometric circle ‘(center,radius)’
pg_catalog | cstring |
pg_catalog | date | ANSI SQL date
pg_catalog | double precision | double-precision floating pointnumber, 8-byte storage
pg_catalog | inet | IP address/netmask, host address,netmask optional
pg_catalog | int2vector | array of int2, used in system tables
pg_catalog | integer | -2 billion to 2 billion integer, 4-byte
pg_catalog | internal |
pg_catalog | interval | @ , time interval
pg_catalog | language_handler |
pg_catalog | line | geometric line (not implemented)’
pg_catalog | lseg | geometric line segment ‘(pt1,pt2)’
pg_catalog | macaddr | XX:XX:XX:XX:XX:XX, MAC address
pg_catalog | money | monetary amounts, $d,ddd.cc
pg_catalog | name | 63-character type for storing system id
pg_catalog | numeric | numeric(precision, decimal), arbitrary
pg_catalog | oid | object identifier(oid), maximum 4billion
pg_catalog | oidvector | array of oids, used in system tables
pg_catalog | opaque |
pg_catalog | path | geometric path ‘(pt1,…)’
pg_catalog | point | geometric point ‘(x, y)’
pg_catalog | polygon | geometric polygon ‘(pt1,…)’
pg_catalog | real | single-precision floating point number, 4-byte storage

pg_catalog | record |
pg_catalog | refcursor | reference cursor (portal name)
pg_catalog | regclass | registered class
pg_catalog | regoper | registered operator
pg_catalog | regoperator | registered operator (with args)
pg_catalog | regproc | registered procedure
pg_catalog | regprocedure | registered procedure (with args)
pg_catalog | regtype | registered type
pg_catalog | reltime | relative, limited-range time interval
pg_catalog | smallint | -32 thousand to 32 thousand, 2-byte
pg_catalog | smgr | storage manager
pg_catalog | text | variable-length string, nolimitspecified
pg_catalog | tid | (Block,offset),physical location oftuple
pg_catalog | time with time zone | hh:mm:ss, ANSI SQL time
pg_catalog | time without time zone | hh:mm:ss, ANSI SQL time
pg_catalog | timestamp with time zone | date and time with time zone
pg_catalog | timestamp without time zone | date and time
pg_catalog | tinterval | (abstime,abstime), time interval
pg_catalog | void |
pg_catalog | xid | transaction id
(61 rows)
Terlihat tipe data yang didukung jumlahnya ada 61 buah. Tipe data di atas merupakan tipe data tambahan dari tipe data default yang didukung PostgreSQL berdasarkan Standar ANSI 92. Jadi tidak terlihat tipe data seperti VARCHAR,
VARCHAR(2) atau INT. Karena secara default PostgreSQL sudah mendukung hampir semua tipe data yang digunakan pada DBMS modern pada umumnya.


Share on Google Plus

About Betacenturia

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.