Re: poll: CHECK TRIGGER? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: poll: CHECK TRIGGER?
Date
Msg-id 12653.1330965670@sss.pgh.pa.us
Whole thread Raw
In response to Re: poll: CHECK TRIGGER?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: poll: CHECK TRIGGER?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I confess to some bafflement about why we need dedicated syntax for
> this, or even any kind of core support at all.  What would be wrong
> with defining a function that takes regprocedure as an argument and
> does whatever?  Sure, it's nicer syntax, but we've repeatedly rejected
> patches that only provided nicer syntax on the grounds that syntax is
> not free, and therefore syntax alone is not a reason to change the
> core grammar.  What makes this case different?

There's definitely something to be said for that, since it entirely
eliminates the problem of providing wildcards and control over which
function(s) to check --- the user could write a SELECT from pg_proc
that slices things however he wants.

The trigger case would presumably take arguments matching pg_trigger's
primary key, viz check_trigger(trig_rel regclass, trigger_name name).

But as for needing "core support", we do need to extend the API for PL
validators, so it's not like this could be done as an external project.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)
Next
From: Simon Riggs
Date:
Subject: Re: RFC: Making TRUNCATE more "MVCC-safe"