I am new to PostgreSQL database(9.5.0), I need to store my json data in PostgreSQL database, so that I need to create a table for it, how can I create a table for it to store my json object on clicking of submit button from my front-end, so that it will be stored in created database table and my sample josn object is as follows(having key/value pairs, contains files also), Please help me.
{"key1":"value1","key2":"value2","key3":"value3","key4_file_name":"Test.txt"}
PostgreSQL has the json
and jsonb
(b for binary) data types. You can use these in your table definitions just like any other data type. If you plan to merely store the json data then the json
data type is best. If, on the other hand, you plan to do a lot of analysis with the json data inside the PG server, then the jsonb
data type is best.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With