Re: Enhanced error message to include hint messages for redundant options error

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Enhanced error message to include hint messages for redundant options error
Date: 2021-05-04 07:19:23
Message-ID: CALj2ACXB0en-4S5ATrvP-0jThsYsAHWOOQFOewMuPA5D_6h+VA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 3, 2021 at 1:41 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Mon, May 3, 2021 at 12:08 PM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > On Sun, May 2, 2021 at 8:44 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> > > On Sat, May 1, 2021 at 9:02 PM Bharath Rupireddy
> > > <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > > >
> > > > On Sat, May 1, 2021 at 7:25 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > > > > > > I'm not attaching above one line change as a patch, maybe Vignesh can
> > > > > > > merge this into the main patch.
> > > > >
> > > > > Thanks for the comments. I have merged the change into the attached patch.
> > > > > Thoughts?
> > > >
> > > > Thanks! v4 basically LGTM. Can we park this in the current commitfest
> > > > if not done already?
> > > >
> > > > Upon looking at the number of places where we have the "option \"%s\"
> > > > specified more than once" error, I, now strongly feel that we should
> > > > use goto duplicate_error approach like in compute_common_attribute, so
> > > > that we will have only one ereport(ERROR. We can change it in
> > > > following files: copy.c, dbcommands.c, extension.c,
> > > > compute_function_attributes, sequence.c, subscriptioncmds.c,
> > > > typecmds.c, user.c, walsender.c, pgoutput.c. This will reduce the LOC
> > > > greatly.
> > > >
> > > > Thoughts?
> > >
> > > I have made the changes for this, I have posted the same in the v5
> > > patch posted in my earlier mail.
> >
> > Thanks! The v5 patch looks good to me. Let's see if all agree on the
> > goto duplicate_error approach which could reduce the LOC by ~80.
>
> I think the "goto duplicate_error" approach looks good, it avoids
> duplicating the same error code multiple times.

Thanks. I will mark the v5 patch "ready for committer" if no one has comments.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2021-05-04 08:07:48 Re: .ready and .done files considered harmful
Previous Message Bharath Rupireddy 2021-05-04 07:13:53 Re: Simplify backend terminate and wait logic in postgres_fdw test