Re: Dynamically accessing columns from a row type in a trigger

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Dynamically accessing columns from a row type in a trigger
Date: 2023-08-15 00:49:14
Message-ID: 4c1e0917-4ee8-6a10-f06b-dae47bd05ae7@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

So the less obvious solution that works is to create a temporary
> table. A little verbose, but I get to keep the types.
>
> `CREATE TEMPORARY TABLE _ ON COMMIT DROP AS SELECT OLD.*;`
>
> _ as a table name makes things a little easier to type.
>
>
>
> Rhys
> Peace & Love | Live Long & Prosper
>
>
If the connection creating the table is long-lived, maybe make the table
once and truncate instead.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sai Teja 2023-08-15 02:40:53 Re: Fatal Error : Invalid Memory alloc request size 1236252631
Previous Message Rhys A.D. Stewart 2023-08-15 00:20:34 Re: Dynamically accessing columns from a row type in a trigger