Re: transition tables and UPDATE

2023-02-02 Thread Corey Huinker
> > > even uglier than what I already had. So yeah, I think it might be > useful if we had a way to inject a counter or something in there. > > This came up for me when I was experimenting with making the referential integrity triggers fire on statements rather than rows. Doing so has the potentia

Re: transition tables and UPDATE

2023-02-01 Thread Yugo NAGATA
On Wed, 1 Feb 2023 10:03:26 +0100 Alvaro Herrera wrote: > Earlier today I gave a talk about MERGE and wanted to provide an example > with FOR EACH STATEMENT triggers using transition tables. However, I > can't find a non-ugly way to obtain the NEW row that corresponds to each > OLD row ... I ha

Re: transition tables and UPDATE

2023-02-01 Thread Dean Rasheed
On Wed, 1 Feb 2023 at 12:12, Alvaro Herrera wrote: > > I had tried to tie these relations using WITH ORDINALITY, but the only > way I could think of (array_agg to then unnest() WITH ORDINALITY) was > even uglier than what I already had. So yeah, I think it might be > useful if we had a way to inj

Re: transition tables and UPDATE

2023-02-01 Thread Alvaro Herrera
On 2023-Feb-01, Thomas Munro wrote: > On Wed, Feb 1, 2023 at 10:18 PM Alvaro Herrera > wrote: > > Earlier today I gave a talk about MERGE and wanted to provide an example > > with FOR EACH STATEMENT triggers using transition tables. However, I > > can't find a non-ugly way to obtain the NEW row

Re: transition tables and UPDATE

2023-02-01 Thread Thomas Munro
On Wed, Feb 1, 2023 at 10:18 PM Alvaro Herrera wrote: > Earlier today I gave a talk about MERGE and wanted to provide an example > with FOR EACH STATEMENT triggers using transition tables. However, I > can't find a non-ugly way to obtain the NEW row that corresponds to each > OLD row ... I had t