Using Array Data types in PostgreSQL
While the PostgreSQL data types that you have explored so far allow you to store many different types of data, occasionally you will want to store a series of values in a table. For example, you might want to store a list of the products that a customer has purchased or the employee ID numbers associated with a specific dealership. For this scenario, PostgreSQL offers the ARRAY
data type, which allows you to store a list of values.
Starting with Arrays
PostgreSQL arrays allow you to store multiple values in a field in a table. For example, consider the following first record in the customers
table:
customer_id | 1 title | NULL first_name | Arlena last_name | Riveles suffix | NULL email | [email protected] gender | F ip_address | 98.36.172.246 phone | NULL street_address | NULL city | NULL state | NULL...