Skip to content

Instantly share code, notes, and snippets.

@khaliqgant
Created March 16, 2022 08:48
Show Gist options
  • Save khaliqgant/fdbcf905c340445b4c788760da64a6f0 to your computer and use it in GitHub Desktop.
Save khaliqgant/fdbcf905c340445b4c788760da64a6f0 to your computer and use it in GitHub Desktop.
[Postgres Dump A Table As JSON] Dump a table in JSON format #postgres #database
\t
\a
\o data.json
select json_agg(t) FROM (SELECT * from schedules_required_shifts) t;
// https://dba.stackexchange.com/questions/90482/export-postgres-table-as-json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment