Add errdetail for bail_out errors in guc_file.l

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Add errdetail for bail_out errors in guc_file.l
Date: 2021-09-23 03:24:26
Message-ID: CALj2ACVpxCywwPHcTcddAfq9y7C9r7AL7=rrx71jEwLRRwAXtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently the following messages are shown in server log if bail_out
errors occur in guc_file.l. This leaves the (naive) users with no clue
as to where to look for the exact errors:
errmsg("configuration file \"%s\" contains errors",
errmsg("configuration file \"%s\" contains errors; unaffected changes
were applied",
errmsg("configuration file \"%s\" contains errors; no changes were applied",
2021-09-22 15:16:45.788 UTC [8241] LOG: configuration file
"/home/uuser/postgres/inst/bin/data/postgresql.auto.conf" contains
errors; unaffected changes were applied

But the user can get to know the parameters for which the errors
happened via pg_file_settings view or pg_show_all_file_settings(). Can
we specify this information in the errdetail for these bail_out
errors, something like errdetail("See pg_file_settings view for more
information.") or errdetail("Check pg_file_settings view for the
errors.") or some other better wording?

In the same guc_file.l for parse_error, a clear indication (line
number and near end of line or near token) is provided, so that users
can easily identify where the error was.
2021-09-22 15:17:11.051 UTC [8241] LOG: syntax error in file
"/home/bharath/postgres/inst/bin/data/postgresql.auto.conf" line 3,
near end of line

Thoughts?

Regards,
Bharath Rupireddy.

Browse pgsql-hackers by date

  From Date Subject
Next Message wenjing 2021-09-23 03:48:56 Re: [Proposal] Global temporary tables
Previous Message Amit Kapila 2021-09-23 03:11:56 Re: relation OID in ReorderBufferToastReplace error message