PostgreSQL 11 Documentation: Chapter 8. Data Types
Chapter 8. Data Types
Table of Contents
8.1. Numeric Types8.1.1. Integer Types8.1.2. Arbitrary Precision Numbers8.1.3. Floating-Point Types8.1.4. Serial Types8.2. Monetary Types8.3. Character Types8.4. Binary Data Types8.4.1. bytea
Hex Format8.4.2. bytea
Escape Format8.5. Date/Time Types8.5.1. Date/Time Input8.5.2. Date/Time Output8.5.3. Time Zones8.5.4. Interval Input8.5.5. Interval Output8.6. Boolean Type8.7. Enumerated Types8.7.1. Declaration of Enumerated Types8.7.2. Ordering8.7.3. Type Safety8.7.4. Implementation Details8.8. Geometric Types8.8.1. Points8.8.2. Lines8.8.3. Line Segments8.8.4. Boxes8.8.5. Paths8.8.6. Polygons8.8.7. Circles8.9. Network Address Types8.9.1. inet
8.9.2. cidr
8.9.3. inet
vs. cidr
8.9.4. macaddr
8.9.5. macaddr8
8.10. Bit String Types8.11. Text Search Types8.11.1. tsvector
8.11.2. tsquery
8.12. UUID Type8.13. XML Type8.13.1. Creating XML Values8.13.2. Encoding Handling8.13.3. Accessing XML Values8.14. JSON Types8.14.1. JSON Input and Output Syntax8.14.2. Designing JSON documents effectively8.14.3. jsonb
Containment and Existence8.14.4. jsonb
Indexing8.14.5. Transforms8.15. Arrays8.15.1. Declaration of Array Types8.15.2. Array Value Input8.15.3. Accessing Arrays8.15.4. Modifying Arrays8.15.5. Searching in Arrays8.15.6. Array Input and Output Syntax8.16. Composite Types8.16.1. Declaration of Composite Types8.16.2. Constructing Composite Values8.16.3. Accessing Composite Types8.16.4. Modifying Composite Types8.16.5. Using Composite Types in Queries8.16.6. Composite Type Input and Output Syntax8.17. Range Types8.17.1. Built-in Range Types8.17.2. Examples8.17.3. Inclusive and Exclusive Bounds8.17.4. Infinite (Unbounded) Ranges8.17.5. Range Input/Output8.17.6. Constructing Ranges8.17.7. Discrete Range Types8.17.8. Defining New Range Types8.17.9. Indexing8.17.10. Constraints on Ranges8.18. Domain Types8.19. Object Identifier Types8.20. pg_lsn Type8.21. Pseudo-Types
PostgreSQL has a rich set of native data types available to users. Users can add new types to PostgreSQL using the CREATE TYPE command.
Table 8.1 shows all the built-in general-purpose data types. Most of the alternative names listed in the “Aliases” column are the names used internally by PostgreSQL for historical reasons. In addition, some internally used or deprecated types are available, but are not listed here.