From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lorusso Domenico <domenico.l76@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to manipulate field in New record
Date: Wed, 7 Jun 2023 06:57:25 -0700
Message-ID: <bc247a58-0530-0cf6-e91c-e829f1db9001@aklaver.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 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.klaver@aklaver.com
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: adrian.klaver@aklaver.com, domenico.l76@gmail.com
Subject: Re: How to manipulate field in New record
In-Reply-To: <bc247a58-0530-0cf6-e91c-e829f1db9001@aklaver.com>
References: <CAJMpnG4biUFYcWW-RGLp+CuSoJ2_o9U+CXvdp9GzOZfNbiF9+g@mail.gmail.com> <bc247a58-0530-0cf6-e91c-e829f1db9001@aklaver.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