postgresql/src/backend/tcop
Dean Rasheed 2bfb50b3df Improve reporting of "conflicting or redundant options" errors.
When reporting "conflicting or redundant options" errors, try to
ensure that errposition() is used, to help the user identify the
offending option.

Formerly, errposition() was invoked in less than 60% of cases. This
patch raises that to over 90%, but there remain a few places where the
ParseState is not readily available. Using errdetail() might improve
the error in such cases, but that is left as a task for the future.

Additionally, since this error is thrown from over 100 places in the
codebase, introduce a dedicated function to throw it, reducing code
duplication.

Extracted from a slightly larger patch by Vignesh C. Reviewed by
Bharath Rupireddy, Alvaro Herrera, Dilip Kumar, Hou Zhijie, Peter
Smith, Daniel Gustafsson, Julien Rouhaud and me.

Discussion: https://postgr.es/m/CALDaNm33FFSS5tVyvmkoK2cCMuDVxcui=gFrjti9ROfynqSAGA@mail.gmail.com
2021-07-15 08:49:45 +01:00
..
Makefile Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
cmdtag.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
dest.c Remove server and libpq support for old FE/BE protocol version 2. 2021-03-04 10:45:55 +02:00
fastpath.c Message style improvements 2021-06-28 08:36:44 +02:00
postgres.c Allow compute_query_id to be set to 'auto' and make it default 2021-05-15 14:13:09 -04:00
pquery.c Centralize the logic for protective copying of utility statements. 2021-06-18 11:22:58 -04:00
utility.c Improve reporting of "conflicting or redundant options" errors. 2021-07-15 08:49:45 +01:00