Re: Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-08 Thread Adrian Klaver
help or directions. And there might be simpler solutions to this problem, which I would like to know about. Also see my question on SO: https://stackoverflow.com/questions/57830543/convert-a-row-to-a-nested-json-document-containing-all-relations-in-postgresql -- Adrian Klaver adrian.kla...@aklaver.com

Re: Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-08 Thread Ali Alizadeh
Also see my question on SO: https://stackoverflow.com/questions/57830543/convert-a-row-to-a-nested-json-document-containing-all-relations-in-postgresql

Re: Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-07 Thread Adrian Klaver
On 9/6/19 9:35 PM, Ali Alizadeh wrote: Hello. In PostgreSQL 10.10, I have created a trigger function that converts the `|NEW|` row to a JSON object using |`to_jsonb(NEW)|`. But now I need to include the records on the other side of the foreign keys in |`NEW|` record in the JSON object in a n

Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-07 Thread Ali Alizadeh
Hello. In PostgreSQL 10.10, I have created a trigger function that converts the `NEW` row to a JSON object using `to_jsonb(NEW)`. But now I need to include the records on the other side of the foreign keys in `NEW` record in the JSON object in a nested fashion. What is the best and most gene