Re: Rejecting redundant options in Create Collation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Rejecting redundant options in Create Collation
Date
Msg-id 1055272.1601578733@sss.pgh.pa.us
Whole thread Raw
In response to Rejecting redundant options in Create Collation  ("Daniel Verite" <daniel@manitou-mail.org>)
List 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 by date:

Previous
From: "Daniel Verite"
Date:
Subject: Rejecting redundant options in Create Collation
Next
From: Andres Freund
Date:
Subject: buildfarm animal shoveler failing with "Illegal instruction"