Re: review: CHECK FUNCTION statement

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: review: CHECK FUNCTION statement
Дата
Msg-id CAFj8pRCcQJJ95PceyVT77rPxnZb0DXK4_kYzqAfk5A=P64ZL3g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: review: CHECK FUNCTION statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: review: CHECK FUNCTION statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hello

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")

one parameter function is old validator, three parameters function is checker.

Question:

What is a correct signature for this function? We cannot use a
overloading, because we can have only one validator function per
language. We can change a validator to support both forms, and we have
to be carefully and correct if we will work with our validators(3 and
more params) or foreign validators (1 param). We should to support
both (compatibility reasons). We are not careful about validators now
- there are some places, where one parameter is hardly expected - this
should be changed. So using validator for checking doesn't mean
smaller patch, but is true, so these functions has similar semantic -
validator is usually "low level" checker.

What is your opinion?

Regards

Pavel


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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Word-smithing doc changes
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Why so few built-in range types?