Skip to content

Instantly share code, notes, and snippets.

@kracekumar
Created February 3, 2017 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kracekumar/3f4bcdd16d080b5a36436370823e0495 to your computer and use it in GitHub Desktop.
Save kracekumar/3f4bcdd16d080b5a36436370823e0495 to your computer and use it in GitHub Desktop.
Postgres function `row_to_json` convert a particular row to JSON object.
test=# select row_to_json(author) from author;
{"id":1,"name":"Leo Tolstoy"}
{"id":2,"name":"Kafka"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment