Re: review: CHECK FUNCTION statement

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: review: CHECK FUNCTION statement
Дата
Msg-id CAFj8pRC6Oc=v55rVMWUxsH-NNg6RHvvP67mFcL8xL07BJnGzhQ@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
2011/11/30 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> 2011/11/30 Alvaro Herrera <alvherre@commandprompt.com>:
>>> How about
>>> CHECK (parse, names=off) FUNCTION foobar(a, b, c)
>
>> this syntax is relative consistent with EXPLAIN, is it ok for all?
>
> It seems pretty awkward to me, particularly putting the options before
> the second keyword of the command --- that could bite us if we ever want
> some other flavors of CHECK command.  I prefer Robert's suggestion of a
> WITH clause at the end.

we can provide both versions - as can be fine for people. Is is simple
in parser. I like both variants and I am thinking so much more
important is a API of checker function and behave of CHECK FUNCTION
statement.

Just idea - don't kill me :). Because CHECK FUNCTION  is not
destructive , then complete signature is not necessary, and when
function name is unique, then parameters should be optional - it can
be comfortable for manual work, so just CHECK FUNCTION name; can work.
I see a usage for option - a entering  parameter's values instead
signature. When I started with overloaded functions, sometimes I had a
problem with identification of function that was executed - CHECK
FUNCTION can help

CHECK FUNCTION name(10,20) WITH (values);
Notice: checking function name(int, int, int default 20)

I would to design API of checker function be friendly to direct call.
There was some ideas to design CHECK FUNCTION for possibility to check
all functions in schema or language. It should be, but we have a
inline statement and system catalog, so anybody can write own scripts
per your requests. And It was one point to decision for separate
checker function from validate function.

Regards

Pavel

>
>                        regards, tom lane
>


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Reserved words and delimited identifiers
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Add minor version to v3 protocol to allow changes without breaking backwards compatibility