Re: Rejecting redundant options in Create Collation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rejecting redundant options in Create Collation
Дата
Msg-id 1055272.1601578733@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Rejecting redundant options in Create Collation  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> Currently, it's not an error for CREATE COLLATION to be invoked
> with options repeated several times. The last (rightmost) value is kept
> and the others are lost.
> ...
> I suggest the attached simple patch to raise an error when any of
> these options is specified multiple times.

Hmm ... I think that that is pretty standard behavior for a lot of
our utility commands.  Trying something at random,

regression=# create operator <<< (leftarg = int, leftarg = int,
regression(# rightarg = int99, procedure = int4pl, rightarg = int);
CREATE OPERATOR

Note the lack of any comment on the flat-out-wrong first value
for rightarg :-(

I can see the argument for complaining about repeated options rather
than letting this pass.  But shouldn't we try to make it uniform
instead of letting different commands have different policies?

            regards, tom lane



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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Rejecting redundant options in Create Collation
Следующее
От: Andres Freund
Дата:
Сообщение: buildfarm animal shoveler failing with "Illegal instruction"