PostgreSQL field type description

Source: Internet
Author: User
Tags postgresql

Bigserial
SERIAL8
Stores a unique integer that is automatically incremented, up to 8 bytes.

BIT
A fixed-length bit string.

BIT VARYING (N)
VARBIT (N)
A variable-length bit string with an n-bit length.

BOOLEAN
Store logical Boolean VALUES (True/false/unknown), which can be true, T, True, Y, yes, and 1, or FALSE, F, False, N, no, and 0.

Bytea
Raw binary data for storing large binary objects (shapes). The storage space used is 4 bytes plus the length of the binary string.

CHAR (N)
CHARACTER (N)
Contains a fixed-length string filled with spaces to length n.

DATE
Store calendar dates (year, month, day) with 4 bytes of storage space.

Datetime
Stores the calendar date and time within days.

DECIMAL (P,s)
NUMERIC (P,s)
Store accurate values, accuracy (p) and scale (s) of 0 or higher.

FLOAT4
REAL
Stores floating-point numbers with a precision of 8 or lower and 6 decimal digits.

FLOAT8
DOUBLE PRECISION
Stores floating-point numbers with a precision of 16 or lower and 15 decimal digits.

SMALLINT
Stores signed or unsigned 2-byte integers.

INTEGER
Stores signed or unsigned 4-byte integers.

INT8
BIGINT
Stores signed or unsigned 8-byte integers.

SERIAL
SERIAL4
Stores the unique integer value that is automatically incremented, up to 4 bytes of storage space.

TEXT
Store large, variable-length string data up to 1 GB. PostgreSQL automatically compresses the TEXT string.

Time (without Time ZONE |
With time ZONE)
Store the time within the day. If the time zone of the database server is not stored, 8 bytes of storage space is used, and 12 bytes are used if the time zone is stored.

TIMESTAMP (without Time ZONE |
With time ZONE)
Stores the date and time. You can store or not store the time zone of the database server, using 8 bytes of storage space.

VARCHAR (N)
CHARACTER VARYING (N)
CHARACTER VARYING
Stores variable-length strings with a maximum length of n. The trailing spaces are not stored.

PostgreSQL field type description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.