Re: CREATE COLLATION - check for duplicate options and error out if found one - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: CREATE COLLATION - check for duplicate options and error out if found one
Date
Msg-id CAEZATCXfQU84HOtNuLpRXUJe_GPcYRPNj5MrZk=YuzAT=f5b0w@mail.gmail.com
Whole thread Raw
In response to Re: CREATE COLLATION - check for duplicate options and error out if found one  (vignesh C <vignesh21@gmail.com>)
Responses Re: CREATE COLLATION - check for duplicate options and error out if found one  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Mon, 31 May 2021 at 15:10, vignesh C <vignesh21@gmail.com> wrote:
>
> On Sat, May 29, 2021 at 9:20 PM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
> >
> > Thanks. PSA v3 patch.
>
> Thanks for the updated patch, the changes look good to me.
>

Hi,

Having pushed [1], I started looking at this, and I think it's mostly
in good shape.

Since we're improving the CREATE COLLATION errors, I think it's also
worth splitting out the error for LOCALE + LC_COLLATE/LC_CTYPE from
the error for FROM + any other option.

In the case of LOCALE + LC_COLLATE/LC_CTYPE, there is an identical
error in CREATE DATABASE, so we should use the same error message and
detail text here.

Then logically, FROM + any other option should have an error of the
same general form.

And finally, it then makes sense to make the other errors follow the
same pattern (with the "specified more than once" text in the detail),
which is also where we ended up in the discussion over in [1].

So, attached is what I propose.

Regards,
Dean

[1] https://www.postgresql.org/message-id/CAEZATCXHWa9OoSAetiZiGQy1eM2raa9q-b3K4ZYDwtcARypCcA%40mail.gmail.com

Attachment

pgsql-hackers by date:

Previous
From: Zhihong Yu
Date:
Subject: Re: Removing unneeded self joins
Next
From: Daniel Gustafsson
Date:
Subject: Re: Avoid repeated PQfnumber() in pg_dump