Re: Inconsistent trigger behavior between two temporal leftovers

From: Sergei Patiakin <sergei(dot)patiakin(at)enterprisedb(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, "Paul A(dot) Jungwirth" <pj(at)illuminatedcomputing(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Inconsistent trigger behavior between two temporal leftovers
Date: 2026-04-30 11:02:40
Message-ID: CANE55rDVrgn+B94cLNqYPqbWA9aLq9mxW-T_npGk0vj3dO85zA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> If you have one, please feel free to add yourself

Thanks Paul, I've done that now

> Maybe this is not a problem in your patch, but I'm confused under what
> circumstances one is supposed to use the return value of
> execute_attr_map_slot(). Existing code appears to be inconsistent about
> that, but there isn't any explanation anywhere I can see.

It looks like `execute_attr_map_slot(attrMap, in_slot, out_slot)` always
returns `out_slot`, so assigning the return value to `out_slot` is a no-op.

I see a couple of such no-op assignments in the codebase - we could remove
them if we think it improves clarity?

I don't have any objections to execute_attr_map_slot's interface - it
seems conventional for functions that copy/transform a data structure
into a caller-passed buffer to also return a pointer to the buffer,
e.g. ExecCopySlot, strcpy(3), realpath(3)

On Mon, Apr 27, 2026 at 11:40 AM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 08.04.26 14:50, Sergei Patiakin wrote:
> > Attaching a patch that makes the behavior more consistent.
>
> Maybe this is not a problem in your patch, but I'm confused under what
> circumstances one is supposed to use the return value of
> execute_attr_map_slot(). Existing code appears to be inconsistent about
> that, but there isn't any explanation anywhere I can see.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2026-04-30 11:14:59 md: measure just FileSync() for pgstat_io without FileClose()
Previous Message Ashutosh Bapat 2026-04-30 10:33:54 Re: deep copy with mutation?