Video: Import data from JSON file to PostgreSQL table in a few clicks
This video shows how to import data from JSON file to PostgreSQL table in a few clicks with Withdata FileToDB, or with the free Import JSON to PostgreSQL online tool. It covers the JSON side and the postgres side.
Import JSON into PostgreSQL: what this does
This shows how to load a JSON file — an API dump, a log export or an app's data — into a PostgreSQL table. It is the reverse of exporting, and useful for getting semi-structured JSON into a queryable, relational table. The video above is the full flow.
Steps
Open Withdata FileToDB and pick your JSON file (an array of objects, or JSON Lines).
Choose PostgreSQL as the destination and connect (host, port, database, user).
Map JSON keys to columns — keys are read as column names; dotted keys map to nested fields.
Pick the load mode: create a new table, append, or update/upsert on a key.
Run the import, then save the session if it repeats.
JSON to PostgreSQL: details worth knowing
Type inference. JSON numbers, true/false and null are mapped to numeric, boolean and NULL columns; strings stay text. Review the inferred types before the first load.
Nested objects and arrays. A nested object or array has no single column — either flatten it into dotted columns, or keep it in a jsonb column.
Auto-create table. The target table can be created from the JSON keys, which is the fastest way to load an unknown shape.
Update vs insert. For repeat loads use upsert with an update key (for example a primary id), otherwise rows are appended and duplicates accumulate.
Errors. A single malformed record stops the load unless errors are collected — fix or skip the bad record rather than restarting the whole file.
FAQ
Can it create the table for me?
Yes — the table can be built from the JSON keys and adjusted afterwards.
What if my JSON is nested?
Flatten it to dotted columns, or store the nested part as jsonb.