Re: Triggers should work in isolation, with a final conflict detection step

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Gianluca Calcagni <gclazio(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers should work in isolation, with a final conflict detection step
Date: 2022-08-01 14:20:37
Message-ID: CAKFQuwYo6+t6+1PyaHqs5jsUK-JvzTJafs51N+mEtd0o5Li7Rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sunday, July 31, 2022, Gianluca Calcagni <gclazio(at)hotmail(dot)com> wrote:

>
> The real drawback is that such approach is forgoing the natural principle
> of *"separation of concerns"*! I have been looking into using trigger
> frameworks to solve this problem, but there is no trigger framework that is
> able to meet my main expectations: in short, *isolation* and *conflict
> detection*.
>
> You may notice that I took inspiration from GIT for most of the concepts
> above (e.g. "isolation" actually means "forking").
>
> I realize that this is a huge request,
>

So install a single c-language trigger function that does all of that and
provide some functions to manage adding delegation commands in user-space.
Make it all work with create extension. Users will have to adhere to the
guidelines suggested.

I am against having core incorporate such code into the main project. The
benefits/cost_complexity ratio is too small.

IOW, I suspect the only realistic way this gets into core is if you, its
champion, pay to have it developed, but even then I don’t think we should
accept such a feature even if it was well written. So if you go that route
it should leverage extension mechanisms. We may add some code hooks though
if those are requested and substantiated.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2022-08-01 14:24:24 Re: Typo in pg_db_role_setting.h
Previous Message Tom Lane 2022-08-01 14:16:08 Re: Typo in pg_db_role_setting.h