Re: pg_hba_file_settings view patch

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_hba_file_settings view patch
Date: 2017-01-26 02:17:41
Message-ID: CAB7nPqT5--fhoR5iBrTv3+HbY_dy3ZCQCpXK2mNTHwvOHjOO8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 26, 2017 at 2:32 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The way I'd be inclined to make the individual reporting changes is like
>
> if (!EnableSSL)
> + {
> - ereport(LOG,
> + ereport(elevel,
> (errcode(ERRCODE_CONFIG_FILE_ERROR),
> errmsg("hostssl record cannot match because SSL is disabled"),
> errhint("Set ssl = on in postgresql.conf."),
> errcontext("line %d of configuration file \"%s\"",
> line_num, HbaFileName)));
> + *err_msg = pstrdup("hostssl record cannot match because SSL is disabled");
> + }
>
> which is considerably less invasive and hence easier to review, and
> supports reporting different text in the view than appears in the log,
> should we need that. It seems likely also that we could drop the pstrdup
> in the case of constant strings (we'd still need psprintf if we want to
> insert values into the view messages), which would make this way cheaper
> than what's in the patch now.

I don't really understand the argument about readability of the patch
as what Haribabu has proposed is simply to avoid a duplicate of the
strings and the diffs of the patch are really clear. For the sake of
not translating the strings sent back to the system view though I can
buy it.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-01-26 02:38:02 Re: BUG: pg_stat_statements query normalization issues with combined queries
Previous Message Craig Ringer 2017-01-26 02:14:06 Re: logical decoding of two-phase transactions