Re: How to manipulate field in New record

From: Lorusso Domenico <domenico(dot)l76(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to manipulate field in New record
Date: 2023-06-07 16:46:44
Message-ID: CAJMpnG6ce-3ugCTTiFuN7EFy0Viza-FSq5SYEat0gCCyMrGKhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

yes I know, the trigger should be before insert update and delete, and the
function decide what manipulate basing on TG_OP

Il giorno mer 7 giu 2023 alle ore 15:57 Adrian Klaver <
adrian(dot)klaver(at)aklaver(dot)com> ha scritto:

> On 6/7/23 05:12, Lorusso Domenico wrote:
> > Hello,
> > Looking for a global solution I've write e trigger function that as
> > optional parameter (argv[0]) receive the name of a specific parameter.
> >
> > My need is to get the filed from NEW and OLD record manipulate and set
> > back the field with new value.
>
> A new row won't have the OLD RECORD.
>
> Read:
>
> https://www.postgresql.org/docs/current/plpgsql-trigger.html
>
> and look at the examples.
>
> >
> > Problem 1: how to get and set this field
> > Problem 2: the field has Composit type
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com
>
>

--
Domenico L.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Don Seiler 2023-06-07 21:12:16 Native Logical Replication Initial Import Qs
Previous Message Adrian Klaver 2023-06-07 13:57:25 Re: How to manipulate field in New record