Re: CREATE COLLATION - check for duplicate options and error out if found one

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: CREATE COLLATION - check for duplicate options and error out if found one
Дата
Msg-id CAEZATCU0J9MAnC3qu5Xzj70vBwj-+cUP1n5eWn6a=7UOK6V-aw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CREATE COLLATION - check for duplicate options and error out if found one  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Sat, 17 Jul 2021 at 05:24, Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> I also think that if it is specified as CREATE FUNCTION ... STRICT
> STRICT, CREATE FUNCTION ... CALLED ON NULL INPUT RETURNS NULL ON NULL
> INPUT etc. isn't the syntaxer catching that error while parsing the
> SQL text, similar to CREATE COLLATION mycoll1 FROM FROM "C";?

No, they're processed quite differently. The initial parsing of CREATE
FUNCTION allows an arbitrary list of things like STRICT, CALLED ON
NULL INPUT, etc., which it turns into a list of DefElem that is only
checked later on. That's the most natural way to do it, since this is
really just a list of options that can appear in any order, much like
the version of CREATE COLLATION that allows options in parentheses,
which is quite different from the version that takes a single FROM.
Reading the relevant portions of gram.y is probably the easiest way to
understand it.

It's actually quite instructive to search for "makeDefElem" in gram.y,
and see all the places that create a DefElem that doesn't match the
user-entered syntax. There are quite a few of them, and there may be
others elsewhere.

Regards,
Dean



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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: CREATE COLLATION - check for duplicate options and error out if found one
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Remove redundant strlen call in ReplicationSlotValidateName