PostgreSQL 기본강좌
데이터 타입 0 0 49,037

by PostgreSQL PostgreSQL 데이터타입 [2015.11.23]


PostgreSQL은 사용자가 쓸 수 있는 풍부한 데이터 유형이 있습니다. 그리고 CREATE TYPE를 이용해서 새로운 데이터 타입을 정의할 수도 있습니다.

PostgreSQL의 데이터 타입은 일반적으로 널리 정의된 포맷을 따릅니다. 하지만 PostgreSQL의 Date나 Time 타입 등 몇몇 함수들은 고유의 포맷을 따릅니다. 그래서 PostgreSQL에서 Date나 Time 타입을 사용할 때 주의해야 합니다.

PostgreSQL의 Data Type는 다음과 같이 구성되어 있습니다.

Name Aliases Description
Bigint int8 signed 8byte 정수형
Bigserial serial8 자동증가 8byte 정수형
bit [ (n) ] 고정길이 bit string
bit varying [ (n) ] Varbit 가변길이 bit string
Boolean Bool Boolean연산 (true/false)
Box 평면 위의 직사각형 상자
Bytea 이진 data ("byte array")
character [ (n) ] char [ (n) ] 고정길이 character string
character varying [ (n) ] varchar [ (n) ] 가변길이 character string
Cidr IPv4 or IPv6 network address
Circle 평면 위의 면
Date 달력 날짜 (year, month, day)
double precision float8 double precision floating-point number (8 bytes)
Inet IPv4, IPv6 host address
Integer int, int4 signed four-byte 정수형
interval [ fields ] [ (p) ] time 구간
Json 문자 JSON data
Jsonb 이진 JSON data, decomposed
Line 평면 위의 직선
Lseg 평면의 선분
Macaddr MAC (Media Access Control) address
Money 현금 총액
numeric [ (p, s) ] decimal [ (p, s) ] exact numeric of selectable precision
Path 평면의 geometric path
pg_lsn PostgreSQL Log 번호
Point 평면의 geometric point
Polygon 평면의 closed geometric path
Real float4 single precision floating-point number (4 bytes)
Smallint int2 signed 2bytes 정수형
Smallserial serial2 자동증가 2bytes 정수형
Serial serial4 자동증가 4bytes 정수형
Text 가변길이 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 ] 날짜와 시간 (no time zone)
timestamp [ (p) ] with time zone timestamptz 날짜와 시간, including time zone
Tsquery text 검색 쿼리
Tsvector text 검색 문서
txid_snapshot user수준 transaction ID snapshot
Uuid universally unique identifier
Xml XML data

- 강좌 URL : http://www.gurubee.net/lecture/2947

- 구루비 강좌는 개인의 학습용으로만 사용 할 수 있으며, 다른 웹 페이지에 게재할 경우에는 출처를 꼭 밝혀 주시면 고맙겠습니다.~^^

- 구루비 강좌는 서비스 제공을 위한 목적이나, 학원 홍보, 수익을 얻기 위한 용도로 사용 할 수 없습니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입