Created
January 17, 2022 21:12
-
-
Save mrsarm/a0eaedb05df997e343b43097a7be74e5 to your computer and use it in GitHub Desktop.
psql-output-json.sql: Output SQL results from Psql into a JSON file (JSON Line file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# \t\a\o /tmp/out.json | |
--Tuples only is off. | |
--Output format is aligned. | |
SELECT row_to_json(r) FROM my_table AS r; | |
# \t\a\o | |
--Tuples only is off. | |
--Output format is aligned. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment