8. ÀÚ·áÇü

차례
8.1. ¼ýÀÚ ÀÚ·áÇü
8.1.1. Integer Types
8.1.2. Arbitrary Precision Numbers
8.1.3. Floating-Point Types
8.1.4. Serial Types
8.2. Monetary Types
8.3. Character Types
8.4. Binary Data Types
8.5. Date/Time Types
8.5.1. Date/Time Input
8.5.2. Date/Time Output
8.5.3. Time Zones
8.5.4. Internals
8.6. Boolean Type
8.7. Geometric Types
8.7.1. Points
8.7.2. Line Segments
8.7.3. Boxes
8.7.4. Paths
8.7.5. Polygons
8.7.6. Circles
8.8. Network Address Types
8.8.1. inet
8.8.2. cidr
8.8.3. inet vs. cidr
8.8.4. macaddr
8.9. Bit String Types
8.10. Arrays
8.10.1. Declaration of Array Types
8.10.2. Array Value Input
8.10.3. Accessing Arrays
8.10.4. Modifying Arrays
8.10.5. Searching in Arrays
8.10.6. Array Input and Output Syntax
8.11. Composite Types
8.11.1. Declaration of Composite Types
8.11.2. Composite Value Input
8.11.3. Accessing Composite Types
8.11.4. Modifying Composite Types
8.11.5. Composite Type Input and Output Syntax
8.12. Object Identifier Types
8.13. Pseudo-Types
8.14. XML Document Support

PostgreSQL has a rich set of native data types available to users. Users may add new types to PostgreSQL using the CREATE TYPE command.

표 8-1 shows all the built-in general-purpose data types. Most of the alternative names listed in the "Aliases" column are the names used internally by PostgreSQL for historical reasons. In addition, some internally used or deprecated types are available, but they are not listed here.

표 8-1. ÀÚ·áÇü

À̸§º°Äª¼³¸í
bigintint8ºÎÈ£ÀÖ´Â 8¹ÙÀÌÆ® Á¤¼ö
bigserialserial8ÀÚµ¿Áõ°¡ 8¹ÙÀÌÆ® Á¤¼ö
bit [ (n) ] °íÁ¤±æÀÌ ºñÆ® ¹®ÀÚ¿­
bit varying [ (n) ]varbit°¡º¯±æÀÌ ºñÆ® ¹®ÀÚ¿­
booleanbool³í¸®Àû ºÒ¸°Çü (true/false)
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 infinite line in the plane
lseg line segment in the plane
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 (with or without time zone), timestamp (with or without time zone).

Each data type has an external representation determined by its input and output functions. Many of the built-in types have obvious external formats. However, several types are either unique to PostgreSQL, such as geometric paths, or have several possibilities for formats, such as the date and time types. Some of the input and output functions are not invertible. That is, the result of an output function may lose accuracy when compared to the original input.