Re: [fixed] Trigger test

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitrii Bondar <d(dot)bondar(at)postgrespro(dot)ru>
Cc: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Lilian <ontowhee(at)gmail(dot)com>
Subject: Re: [fixed] Trigger test
Date: 2025-04-05 19:54:18
Message-ID: 2720306.1743882858@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dmitrii Bondar <d(dot)bondar(at)postgrespro(dot)ru> writes:
> On 04/04/2025 01:11, Tom Lane wrote:
>> So that's a long laundry list and we haven't even dug hard.
>> Is it worth it? If you feel like doing the legwork then
>> I'm willing to support the project, but I really wonder if
>> we shouldn't cut our losses and just remove the module.

> You wrote a note that I decided to omit. As I mentioned, the patch does
> not even fix the cascade update problem—there are still broken
> cases—because it seems impossible to address it in a gentle way (the
> code was patched 20 years ago; it's truly legacy).

I'm not terribly concerned about whether these triggers have perfect
foreign-key semantics, since no one (in their right mind) would use
them as foreign-key enforcement anyway. What they're good for
is as examples of writing checks and updates in C-coded triggers.
As such, questions like "are identifiers and data values quoted
appropriately" seem far more urgent than whether cascade update
works per spec. Even just using a StringInfo rather than a fixed-size
char[] variable to build the query in would be an improvement.

> I considered removing it entirely, but that seemed too drastic a
> solution (and, at the very least, I don't have enough expertise to make
> that decision).

I'm not that thrilled with giving up on refint.c either. But in its
current state, it's a pretty lousy example. Are we willing to put
enough effort into making it a more useful code example?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien Coelho 2025-04-05 20:14:39 Re: Add partial :-variable expansion to psql \copy
Previous Message Daniel Gustafsson 2025-04-05 19:29:21 Re: Enhancing Memory Context Statistics Reporting