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
, anddouble
)The character data types (
varchar
,char
, andtext
)The binary data types
The date/time data types (including
date
,timestamp without timezone
, andtimestamp 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...