Re: Trigger Function question - Mailing list pgsql-general

From Lorusso Domenico
Subject Re: Trigger Function question
Date
Msg-id CAJMpnG60Zc-AcV=CXuqUhVc3ms224c32W+Qf6B=zDpocNmrtsA@mail.gmail.com
Whole thread Raw
In response to Re: Trigger Function question  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
I've just finish to do the same thing.
For my needs, I decided to create a table with the information I need for each view (yes I set trigger on view not on table).

anyway, hstore is more performant rather than jsonb but both of them could treat NEW and OLD as hashmap (or associative array)


Il giorno lun 10 lug 2023 alle ore 20:53 Christophe Pettus <xof@thebuild.com> ha scritto:


> On Jul 10, 2023, at 11:46, DAVID ROTH <adaptron@comcast.net> wrote:
>
> Is there a way to get new.* into a jsonb column?

The to_jsonb() function accepts a row type like NEW.*, and returns a JSONB object with the keys as column names.



--
Domenico L.

per stupire mezz'ora basta un libro di storia,
io cercai di imparare la Treccani a memoria... [F.d.A.]

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to add function schema in search_path in option definitio
Next
From: Lorusso Domenico
Date:
Subject: Re: How to add function schema in search_path in option definitio