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

Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>

From: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>
Date: 2021-05-08T06:31:22Z
Lists: pgsql-hackers
> > > 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.

Hi,

I looked into the patch and noticed a minor thing.

+	return;				/* keep compiler quiet */
 }

I think we do not need the comment here.
The compiler seems not require "return" at the end of function
when function's return type is VOID.

In addition, it seems better to remove these "return;" like what
commit "3974c4" did.

Best regards,
houzj

Commits

  1. Improve reporting of "conflicting or redundant options" errors.

  2. Refactor function parse_subscription_options.