Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- ssh
- centos
- 28015
- port forwarding
- openpyxl
- mysql
- SWIFT
- Jupyter Notebook
- PYTHON
- kitura
- STF
- Jupyter
- 실행권한
- nGrinder
- ftp
- appium
- perfect
- create table
- insert
- nmap
- postgresql
- Materials
- ubuntu
- GoCD
- rethinkdb
- appium server
- postgres
- nohup
- STF_PortForwarding
- sshpass
Archives
- Today
- Total
don't stop believing
postgresql 데이터 타입과 옵션 본문
postgreSQL 데이터 타입과 옵션들을 확인해 봅시다.
PostgreSQL Data Types
The data type can be any of the following:
- boolean: Use "boolean" or "bool" to declare a true or false value.
- character values
- char: holds a single character
- char (#): holds # number of characters. Spaces will be inserted to fill any extra room.
- varchar (#): holds a maximum of # number of character. Can contain less.
- integer values
- smallint: whole number between -32768 and 32767.
- int: whole number between -214783648 and 214783647.
- serial: Auto-populated integer number.
- floating-point values
- float (#): floating point number with at least # points of precision.
- real: 8-byte floating point number
- numeric (#,after_dec): real number with # number of digits, and after_dec digits after decimal
- date and time values
- date: stores a date value
- time: stores a time value
- timestamp: stores a date and time value
- timestamptz: stores a timestamp that includes timezone data
- interval: stores the difference between two timestamp values
- geometric data
- point: stores a pair of coordinates that define a point
- line: stores a set of points that map out a line
- lseg: stores data that defines a line segment
- box: stores data that defines a rectangle
- polygon: stores data that defines any enclosed space
- device specifications
- inet: stores an IP address
- macaddr: stores a device MAC address
PostreSQL Column and Table Constraints
Column definitions can also have constraints that provide rules for the type of data found in the column. The following can be used as space-separated values following the data type:
- NOT NULL: column cannot have null value
- UNIQUE: column value must not be the same for any record. Null is always considered a unique value
- PRIMARY KEY: combination of the above two constraints. Can only be used once per table
- CHECK: ensure that a condition is true for values in the column
- REFERENCES: value must exist in a column in another table
'Database > PostgreSQL' 카테고리의 다른 글
외부 서버에서 postgresql 접속하기 (2) | 2017.09.27 |
---|---|
sql 파일 실행시키기 (0) | 2017.09.27 |
alter table 사용하기 (0) | 2017.09.26 |
Table 관련 기본 다루기 (0) | 2017.09.26 |
Ubuntu에 PostgreSQL 설치하고 기본 명령 살펴보기 (0) | 2017.09.14 |
Comments