Re: CREATE COLLATION - check for duplicate options and error out if found one
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-15T19:34:38Z
Lists: pgsql-hackers
Attachments
- v4-check-CREATE-COLLATION-options.patch (text/x-patch) patch v4
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
Commits
-
Improve error checking of CREATE COLLATION options.
- ba620760c4c8 15.0 landed