[260121] PostgreSQL ๋ฐ์ดํ„ฐ ํƒ€์ž… ์ข…๋ฅ˜

2026. 1. 21. 20:54ยทํ”„๋กœ๊ทธ๋ž˜๋ฐ

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
'ํ”„๋กœ๊ทธ๋ž˜๋ฐ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
  • [260115] REST API ์™€ ๋ฌด์ƒํƒœ์„ฑ(state less)
  • [260115] HTTP ๋ž€ (http ์ธ์ฆ, http ์‘๋‹ต ์ฝ”๋“œ ๋“ฑ)
  • [260113] ํŠธ๋žœ์ ์…˜์ด๋ž€? (Transaction)
  • ๋ฒ„์ „ ๊ด€๋ฆฌ๋ž€? Git ์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ธฐ, Git๊ณผ GitHub ์ฐจ์ด
jennnnna
jennnnna
  • jennnnna
    ๐Ÿ’ป๐Ÿ€Jennna's BLOG
    jennnnna
  • ์ „์ฒด
    ์˜ค๋Š˜
    ์–ด์ œ
    • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (74) N
      • ์ปดํ“จํ„ฐ (1)
        • Operating system ์šด์˜์ฒด์ œ (8)
      • ํ”„๋กœ๊ทธ๋ž˜๋ฐ (5)
        • JAVA (6)
        • PHP (1)
        • Android (7)
        • Apache (1)
        • Python (0)
      • ๊ณต๋ถ€ (15)
        • ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ ๊ณต๋ถ€๊ธฐ๋ก (12)
        • TIL (3)
      • AI (2) N
      • TTS (1)
      • LLM (2)
      • RAG (1)
      • ์–ดํ•™ (5)
        • English (5)
        • Japanese (ๆ—ฅๆœฌ่ชž) (0)
      • ๊ธ€์“ฐ๊ธฐ (5)
  • ๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

    • ํ™ˆ
    • ๋ฐฉ๋ช…๋ก
  • ๋งํฌ

  • ๊ณต์ง€์‚ฌํ•ญ

  • ์ธ๊ธฐ ๊ธ€

  • ํƒœ๊ทธ

    ๋น„์ „๊ณต์ž๊ฐœ๋ฐœ์ž
    ์šด์˜์ฒด์ œ
    CS์ง€์‹
    ์ž๋ฐ”๊ธฐ์ดˆ
    ์žฅ์ธํ•œ๊ณผ
    ์˜ค๋ธ”์™„
    ์ž๋ฐ”๊ณต์‹๋ฌธ์„œ
    ํ‹ฐ์Šคํ† ๋ฆฌ์ฑŒ๋ฆฐ์ง€
    ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌํ•„๊ธฐ
    ์ •๋ณด์ฒ˜๋ฆฌ๊ธฐ์‚ฌ
    ์•ˆ๋“œ๋กœ์ด๋“œ๊ฐœ๋ฐœ
    ์ •์ฒ˜๊ธฐ
    ์ž๋ฐ”๊ณต๋ถ€
    ์นดํŽ˜์•Œ๋ฐ”
    ์•ˆ๋“œ๋กœ์ด๋“œ
    cs๊ณต๋ถ€
    ์ž๋ฐ”๋…ํ•™
    ๋ฌต์€์ง€์ฐธ์น˜๊น€๋ฐฅ
    ์šด์˜์ฒด์ œ๊ณต๋ถ€
    ๋น„์ „๊ณต์žcs๊ณต๋ถ€
  • ์ตœ๊ทผ ๋Œ“๊ธ€

  • ์ตœ๊ทผ ๊ธ€

  • hELLOยท Designed By์ •์ƒ์šฐ.v4.10.5
jennnnna
[260121] PostgreSQL ๋ฐ์ดํ„ฐ ํƒ€์ž… ์ข…๋ฅ˜
์ƒ๋‹จ์œผ๋กœ

ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”