Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: RAJAMOHAN <garajamohan(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
Date: 2021-02-05 06:11:20
Message-ID: 81341.1612505480@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

RAJAMOHAN <garajamohan(at)gmail(dot)com> writes:
> After checking the logs, I found out that the hba file was not loaded
> successfully because of the invalid character. My concern is
> why pg_reload_conf is returning true if the load was unsuccessful.

A true result only indicates that a SIGHUP signal was sent to the
postmaster; your backend process has no visibility into whether the
signal was even received, never mind whether the postmaster did
what you wanted. (I thought this was adequately documented, but it
seems not.)

> Is there any option to check if the load is successful or not, without
> going through the logs?

The pg_hba_file_rules view can help you debug a faulty pg_hba file.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2021-02-05 06:32:49 Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
Previous Message Raj kumar 2021-02-05 06:08:50 Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed