Book Image

PostgreSQL for Data Architects

By : Jayadevan M
Book Image

PostgreSQL for Data Architects

By: Jayadevan M

Overview of this book

Table of Contents (19 chapters)
PostgreSQL for Data Architects
About the Author
About the Reviewers

Interesting data types

We will start with the data types. PostgreSQL does have all the common data types we see in databases. These include:

  • The number data types (smallint, integer, bigint, decimal, numeric, real, and double)

  • The character data types (varchar, char, and text)

  • The binary data types

  • The date/time data types (including date, timestamp without timezone, and timestamp with timezone)

  • BOOLEAN data types

However, this is all standard fare. Let's start off by looking at the RANGE data type.


This is a data type that can be used to capture values that fall in a specific range. Let's look at a few example use cases.

Cars can be categorized as compact, convertible, MPV, SUV, and so on. Each of these categories will have a price range. For example, the price range of a category of cars can start from $15,000 at the lower end and the price range at the upper end can start from $40,000.

We can have meeting rooms booked for different time slots. Each room is booked during different time slots...