Skip to content

Instantly share code, notes, and snippets.

@xivSolutions
Created July 19, 2014 22:13
Show Gist options
  • Save xivSolutions/50f4944acc3399133dd9 to your computer and use it in GitHub Desktop.
Save xivSolutions/50f4944acc3399133dd9 to your computer and use it in GitHub Desktop.
PG - Include inserted ID in JSON
INSERT INTO "ClientDocuments" ("ClientDocumentId", body) VALUES (nextval('"ClientDocuments_ClientDocumentId_seq"'::regclass), cast('{"id":"' || lastval() || '", "name":"John"}' as json))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment