EN
PostgreSQL - Create table with JSON field
0
points
In this article, we would like to show you how to create table with JSON
field in PostgreSQL.
Quick solution:
CREATE TABLE "table_name" (
"column_name" JSON
);
Practical example
In this example, we create objects
table with id
and json
column which will be JSON
type.
Query:
CREATE TABLE "objects" (
"id" SERIAL PRIMARY KEY,
"json" JSON
);
after we insert some values, we get the following result:
Note:
Go to this article to see how to insert
JSON
type values to the table.