> 1) What side are you talking about, the parent of the record or the
> children?
the children. only one level of depth is fine.
> 2) What procedural language are you using?
PL/pgSQL
As I understand, I need to loop over all columns in the "NEW" record, find out
if the column is a foreign key
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