Pavel Stehule <> writes:
> I rechecked a possibility to use a validator function together with
> checker function.

> The main issue is a different interface of both functions. Validator
> needs just function oid and uses global variable
> check_function_bodies. Checker function needs function oid and
> relation oid (possible some other params). When we mix these two
> functions together we need a

> validator(oid) or validator(oid, oid, variadic "any")

Right, although if you want it to be callable from SQL I think that
variadic "any" is too loose.

> What is a correct signature for this function? We cannot use a
> overloading, because we can have only one validator function per
> language.

So?  You have one validator function, it has either signature;
if it has the old signature then CHECK isn't supported by the language.
We have plenty of examples of this sort of thing already.

One issue that would need to be considered is how the validator tells
the difference between a CREATE FUNCTION call and a CHECK call with
default parameters (no WITH clause).  Those shouldn't do exactly the
same thing, presumably.  Maybe that's a sufficient reason to have two
entry points.

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to