Wednesday , December 25 2024

PostgreSQL Json Data Type

In today’s article, we will explain Creating and Inserting Tables in PostgreSQL Json Data Type.

First, let’s create a two-column data type called afirma.

After creating our table, we make inserts as follows.

After inserting our data, let’s see the data in the table.

Our data seems to be inserted properly, so how do we pull this data?

We will use two operators for this.

-> returns keys of json data.

->> returns value of json data.

Let’s list the Customer and the products sold to the customer in the information column.

If you want to use conditions in the query, you can use it as follows.

You can use the example below to assign indexes to columns created in Json data type.

Loading

About Faruk Erdem

Leave a Reply

Your email address will not be published. Required fields are marked *