본문 바로가기
Lecture/PostgreSQL

PGSQL 자료형

by 알 수 없는 사용자 2012. 12. 4.
반응형

SchemaNameInternal nameSizeDescription
pg_catalog"any"any4
pg_catalog"char"char1single character
pg_catalogabstimeabstime4absolute, limited-range date and time (Unix system time)
pg_catalogaclitemaclitem12access control list
pg_cataloganyarrayanyarrayvar
pg_cataloganyelementanyelement4
pg_cataloganyenumanyenum4
pg_cataloganynonarrayanynonarray4
pg_catalogbigintint88~18 digit integer, 8-byte storage
pg_catalogbitbitvarfixed-length bit string
pg_catalogbit varyingvarbitvarvariable-length bit string
pg_catalogbooleanbool1boolean, true/false
pg_catalogboxbox32geometric box (lower left,upper right)
pg_catalogbyteabyteavarvariable-length string, binary values escaped
pg_catalogcharacterbpcharvarchar(length), blank-padded string, fixed storage length
pg_catalogcharacter varyingvarcharvarvarchar(length), non-blank-padded string, variable storage length
pg_catalogcidcid4command identifier type, sequence in transaction id
pg_catalogcidrcidrvarnetwork IP address/netmask, network address
pg_catalogcirclecircle24geometric circle (center,radius)
pg_catalogcstringcstringvar
pg_catalogdatedate4ANSI SQL date
pg_catalogdouble precisionfloat88double-precision floating point number, 8-byte storage
pg_cataloggtsvectorgtsvectorvarGiST index internal text representation for text search
pg_cataloginetinetvarIP address/netmask, host address, netmask optional
pg_catalogint2vectorint2vectorvararray of int2, used in system tables
pg_catalogintegerint44-2 billion to 2 billion integer, 4-byte storage
pg_cataloginternalinternal4
pg_catalogintervalinterval16@ <number> <units>, time interval
pg_cataloglanguage_handlerlanguage_handler4
pg_cataloglineline32geometric line (not implemented)
pg_cataloglseglseg32geometric line segment (pt1,pt2)
pg_catalogmacaddrmacaddr6XX:XX:XX:XX:XX:XX, MAC address
pg_catalogmoneymoney8monetary amounts, $d,ddd.cc
pg_catalognamename6463-character type for storing system identifiers
pg_catalognumericnumericvarnumeric(precision, decimal), arbitrary precision number
pg_catalogoidoid4object identifier(oid), maximum 4 billion
pg_catalogoidvectoroidvectorvararray of oids, used in system tables
pg_catalogopaqueopaque4
pg_catalogpathpathvargeometric path (pt1,...)
pg_catalogpointpoint16geometric point (x, y)
pg_catalogpolygonpolygonvargeometric polygon (pt1,...)
pg_catalogrealfloat44single-precision floating point number, 4-byte storage
pg_catalogrecordrecordvar
pg_catalogrefcursorrefcursorvarreference cursor (portal name)
pg_catalogregclassregclass4registered class
pg_catalogregconfigregconfig4registered text search configuration
pg_catalogregdictionaryregdictionary4registered text search dictionary
pg_catalogregoperregoper4registered operator
pg_catalogregoperatorregoperator4registered operator (with args)
pg_catalogregprocregproc4registered procedure
pg_catalogregprocedureregprocedure4registered procedure (with args)
pg_catalogregtyperegtype4registered type
pg_catalogreltimereltime4relative, limited-range time interval (Unix delta time)
pg_catalogsmallintint22-32 thousand to 32 thousand, 2-byte storage
pg_catalogsmgrsmgr2storage manager
pg_catalogtexttextvarvariable-length string, no limit specified
pg_catalogtidtid6(block, offset), physical location of tuple
pg_catalogtime with time zonetimetz12hh:mm:ss, ANSI SQL time
pg_catalogtime without time zonetime8hh:mm:ss, ANSI SQL time
pg_catalogtimestamp with time zonetimestamptz8date and time with time zone
pg_catalogtimestamp without time zonetimestamp8date and time
pg_catalogtintervaltinterval12(abstime,abstime), time interval
pg_catalogtriggertrigger4
pg_catalogtsquerytsqueryvarquery representation for text search
pg_catalogtsvectortsvectorvartext representation for text search
pg_catalogtxid_snapshottxid_snapshotvartxid snapshot
pg_catalogunknownunknownvar
pg_cataloguuiduuid16UUID datatype
pg_catalogvoidvoid4
pg_catalogxidxid4transaction id
pg_catalogxmlxmlvarXML content

네트워크 주소를 저장하는 용도인 cidrinetmacaddr 같은 것도 있고, boxcirclelinepathpointpolygon 같은 기하학적 값들을 위한 자료형도 존재한다.

눈여겨 볼 것은, regclass나 regtype 같은 고차 자료형(higher-order types)—자료형을 담는 자료형, Ruby의 Class 객체나 Python의 type 객체 같은 것들—도 존재한다는 사실. regoperregproc 같은 자료형을 보면 알 수 있겠지만, 연산자나 프로시져를 값으로 사용할 수 있기도 하다. regoperatorregprocedure 자료형은 부분 적용(partial application)된 연산자, 프로시져를 담는다.



출처 : http://blog.dahlia.pe.kr/articles/2008/08/29/postgresql-83%EC%9D%98-%EB%82%B4%EC%9E%A5-%EC%9E%90%EB%A3%8C%ED%98%95%EB%93%A4?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+CodeMetaphor+%28Romantic+Binaries%29

'Lecture > PostgreSQL' 카테고리의 다른 글

pgsql utf8 디비 생성시 오류  (0) 2014.07.31
PGSQL 기본 ( 계속 추가 예정 )  (0) 2012.12.04