Site icon Database Tutorials

PostgreSQL Array

In today’s article, we will show you how to work with PostgreSQL array and introduce you to some handy functions for array manipulation.

In this example, we will insert our data in array format and learn how to query this data.

Let’s create our table as above.

Let’s note that there is a [ ] bracket sign at the end of the second and third column.

These are necessary for us to insert in array format.

We can insert our data in several ways.

Secondly, we can perform the insert operation using the ARRAY command as follows.

We inserted our data and let’s make our query.

Let’s reinforce it with another example.

Exit mobile version