Re: review: CHECK FUNCTION statement

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: review: CHECK FUNCTION statement
Дата
Msg-id 24793.1322677803@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: review: CHECK FUNCTION statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Why so few built-in range types?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Large number of open(2) calls with bulk INSERT into empty table