From: hubert depesz lubaczewski <depesz@depesz.com>
To: Lorusso Domenico <domenico.l76@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to manipulate field in New record
Date: Wed, 7 Jun 2023 14:58:49 +0200
Message-ID: <ZIB/CTqNFuQ0C3ck@depesz.com> (raw)
In-Reply-To: <CAJMpnG4biUFYcWW-RGLp+CuSoJ2_o9U+CXvdp9GzOZfNbiF9+g@mail.gmail.com>
References: <CAJMpnG4biUFYcWW-RGLp+CuSoJ2_o9U+CXvdp9GzOZfNbiF9+g@mail.gmail.com>
On Wed, Jun 07, 2023 at 02:12:58PM +0200, 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.
>
> Problem 1: how to get and set this field
> Problem 2: the field has Composit type
Do this in pl/perl, pl/python, pl/tcl or anything like this.
Or use one of methods shown here:
https://www.depesz.com/2021/04/21/getting-value-from-dynamic-column-in-pl-pgsql-triggers/
depesz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: depesz@depesz.com, domenico.l76@gmail.com
Subject: Re: How to manipulate field in New record
In-Reply-To: <ZIB/CTqNFuQ0C3ck@depesz.com>
References: <CAJMpnG4biUFYcWW-RGLp+CuSoJ2_o9U+CXvdp9GzOZfNbiF9+g@mail.gmail.com> <ZIB/CTqNFuQ0C3ck@depesz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox