PostgreSQL ๋ฐ์ดํฐ ํ์ (data types) ์ข ๋ฅ (postgresql ๊ณต์ ํํ ๋ฆฌ์ผ)
https://www.postgresql.org/docs/current/datatype.html
Chapter 8. Data Types
Chapter 8. Data Types Table of Contents 8.1. Numeric Types 8.1.1. Integer Types 8.1.2. Arbitrary Precision Numbers 8.1.3. Floating-Point Types 8.1.4. Serial …
www.postgresql.org
1. ๊ณต์ ๋ฌธ์์ ๋ช ์๋ data type ์ข ๋ฅ
| Name | Aliases | Description |
| bigint | int8 | signed eight-byte integer |
| bigserial | serial8 | autoincrementing eight-byte integer |
| bit [ (n) ] | fixed-length bit string | |
| bit varying [ (n) ] | varbit [ (n) ] | variable-length bit string |
| boolean | bool | logical Boolean (true/false) |
| box | rectangular box on a plane | |
| bytea | binary data (“byte array”) | |
| character [ (n) ] | char [ (n) ] | fixed-length character string |
| character varying [ (n) ] | varchar [ (n) ] | variable-length character string |
| cidr | IPv4 or IPv6 network address | |
| circle | circle on a plane | |
| date | calendar date (year, month, day) | |
| double precision | float, float8 | double precision floating-point number (8 bytes) |
| inet | IPv4 or IPv6 host address | |
| integer | int, int4 | signed four-byte integer |
| interval [ fields ] [ (p) ] | time span | |
| json | textual JSON data | |
| jsonb | binary JSON data, decomposed | |
| line | infinite line on a plane | |
| lseg | line segment on a plane | |
| macaddr | MAC (Media Access Control) address | |
| macaddr8 | MAC (Media Access Control) address (EUI-64 format) | |
| money | currency amount | |
| numeric [ (p, s) ] | decimal [ (p, s) ] | exact numeric of selectable precision |
| path | geometric path on a plane | |
| pg_lsn | PostgreSQL Log Sequence Number | |
| pg_snapshot | user-level transaction ID snapshot | |
| point | geometric point on a plane | |
| polygon | closed geometric path on a plane | |
| real | float4 | single precision floating-point number (4 bytes) |
| smallint | int2 | signed two-byte integer |
| smallserial | serial2 | autoincrementing two-byte integer |
| serial | serial4 | autoincrementing four-byte integer |
| text | variable-length character string | |
| time [ (p) ] [ without time zone ] | time of day (no time zone) | |
| time [ (p) ] with time zone | timetz | time of day, including time zone |
| timestamp [ (p) ] [ without time zone ] | date and time (no time zone) | |
| timestamp [ (p) ] with time zone | timestamptz | date and time, including time zone |
| tsquery | text search query | |
| tsvector | text search document | |
| txid_snapshot | user-level transaction ID snapshot (deprecated; see pg_snapshot) | |
| uuid | universally unique identifier | |
| xml | XML data |
2. ์์ฃผ ์ฌ์ฉ๋๋ ๋ฐ์ดํฐ ํ์ (Data Type)
| ๋ถ๋ฅ | ํ์ ์ด๋ฆ | ์ค๋ช |
| ์ซ์ | integer / bigint | ์ผ๋ฐ ์ ์์ ํฐ ์ ์ (์ฌ์ฉ์๋์ id๊ฐ bigint) |
| ๋ฌธ์ | varchar(n) / text | ๊ฐ๋ณ ๊ธธ์ด ๋ฌธ์์ด. text๋ ๊ธธ์ด ์ ํ์ด ์ฌ์ค์ ์์ |
| ๋ ์ง/์๊ฐ | timestamp / timestamptz | ๋ ์ง์ ์๊ฐ. tz๊ฐ ๋ถ์ผ๋ฉด ํ์์กด ์ ๋ณด ํฌํจ |
| ๋ถ๋ฆฌ์ธ | boolean | true, false, null ์ ์ฅ |
| ๋คํธ์ํฌ | uuid | ๊ณ ์ ์๋ณ์์ฉ (์ฌ์ฉ์๋์ uuid ์ปฌ๋ผ) |
| ๊ธฐํ | json / jsonb | JSON ๋ฐ์ดํฐ ์ ์ฅ. jsonb๊ฐ ๊ฒ์ ์๋๊ฐ ๋ ๋น ๋ฆ |
| ๋ฐฐ์ด | type[] | ๋ชจ๋ ๊ธฐ๋ณธ ํ์ ์ []๋ฅผ ๋ถ์ฌ ๋ฐฐ์ด๋ก ์ฌ์ฉ ๊ฐ๋ฅ |
'ํ๋ก๊ทธ๋๋ฐ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [260115] REST API ์ ๋ฌด์ํ์ฑ(state less) (0) | 2026.01.15 |
|---|---|
| [260115] HTTP ๋ (http ์ธ์ฆ, http ์๋ต ์ฝ๋ ๋ฑ) (0) | 2026.01.15 |
| [260113] ํธ๋์ ์ ์ด๋? (Transaction) (0) | 2026.01.13 |
| ๋ฒ์ ๊ด๋ฆฌ๋? Git ์ฝ๊ฒ ์ดํดํ๊ธฐ, Git๊ณผ GitHub ์ฐจ์ด (0) | 2025.11.16 |