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

From vignesh C
Subject Re: CREATE COLLATION - check for duplicate options and error out if found one
Date
Msg-id CALDaNm2u8pT-5-=XHNk_=jON1x=GWN-0tkNOdp=cinWchFXxdw@mail.gmail.com
Whole thread Raw
In response to Re: CREATE COLLATION - check for duplicate options and error out if found one  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: CREATE COLLATION - check for duplicate options and error out if found one
List pgsql-hackers
On Wed, May 26, 2021 at 7:44 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> On Wed, May 26, 2021 at 7:18 PM vignesh C <vignesh21@gmail.com> wrote:
> > +1 for fixing this issue, we have handled this error in other places.
> > The patch does not apply on head, could you rebase the patch on head
> > and post a new patch.
>
> Thanks. I thought of rebasing once the other patch (which reorganizes
> "...specified more than once" error) gets committed. Anyways, I've
> rebased for now on the latest master. Please review v2 patch.
>

Thanks for the updated patch.
One minor comment:
You can remove the brackets around errcode, You could change:
+ if (localeEl)
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("option \"%s\" specified more than once", defel->defname),
+ parser_errposition(pstate, defel->location)));
to:
+ if (localeEl)
+ ereport(ERROR,
+ errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("option \"%s\" specified more than once", defel->defname),
+ parser_errposition(pstate, defel->location));

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Addition of alias types regpublication and regsubscription
Next
From: Tom Lane
Date:
Subject: Re: Addition of alias types regpublication and regsubscription