Re: Rejecting redundant options in Create Collation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rejecting redundant options in Create Collation
Дата
Msg-id 1221644.1601654878@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Rejecting redundant options in Create Collation  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> Assuming we agree that redundant options should consistently
> raise an error for a certain class of statements, could it be handled
> at the grammar level?

I don't think this'd be a great idea.  The grammar would have to
do something pretty brute-force to check for duplication, whereas
the individual statements typically know already whether they've
seen an instance of a particular option.

It will be kind of annoying to make similar changes in every statement,
agreed.  I wonder if there'd be any value in trying to make a subroutine
that deconstructs a DefElem list according to a provided list of option
names, allowing centralized handling of unknown-option and
duplicate-option cases, and maybe sharing handling of the simpler cases
such as boolean and integer options.  I'm not quite sure what the output
ought to look like though.  Some sort of statement-specific struct would
be really ideal, but C doesn't make that easy.

            regards, tom lane



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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Error code missing for "wrong length of inner sequence" error
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Dumping/restoring fails on inherited generated column