pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSELECT pg_reload_conf(); returning true despite hba file loading was failed
5+ messages / 4 participants
[nested] [flat]
* SELECT pg_reload_conf(); returning true despite hba file loading was failed
@ 2021-02-05 05:59 RAJAMOHAN <garajamohan@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: RAJAMOHAN @ 2021-02-05 05:59 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Hello all,
I came across this situation, where I was allowing some new ip-address to
connect to the database. But while making the change in the hba file i
added a invalid character by mistake. And i reloaded using the
pg_reload_conf function, it returns true. I thought everything was fine,
until the client people reported that they were still not able to login to
the database.
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.
Is there any option to check if the load is successful or not, without
going through the logs?
PostgreSQL 10.15 (Ubuntu 10.15-0ubuntu0.18.04.1)
postgres=# select pg_reload_conf();
pg_reload_conf
----------------
t
In logs below error was reported:
line 45 of configuration file ""/******************/pg_hba.conf"""
LOG,00000,"pg_hba.conf was not reloaded",,,,,,,,"SIGHUP_handler,
postmaster.c:2642","" \
Thanks & Regards,
Rajamohan.J
Mobile : +91 8098167651, +91 7259157485
Email:garajamohan@gmail.com
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
@ 2021-02-05 06:08 Raj kumar <rajkumar820999@gmail.com>
parent: RAJAMOHAN <garajamohan@gmail.com>
1 sibling, 0 replies; 5+ messages in thread
From: Raj kumar @ 2021-02-05 06:08 UTC (permalink / raw)
To: RAJAMOHAN <garajamohan@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Hi all ,
I also faced the same issue when I tried to set host authentication to
peer. As peer is not supported for host, I expected a failure in "pg_ctl
reload" that didnt happen. Reload showed signaled true. But in pg_log,
there were errors saying that reload was unsuccessful since I've set peer
for host.
Any reason why reload works in that way without throwing error?
Thanks,
Raj
On Fri, 5 Feb 2021, 11:30 RAJAMOHAN, <garajamohan@gmail.com> wrote:
> Hello all,
>
> I came across this situation, where I was allowing some new ip-address to
> connect to the database. But while making the change in the hba file i
> added a invalid character by mistake. And i reloaded using the
> pg_reload_conf function, it returns true. I thought everything was fine,
> until the client people reported that they were still not able to login to
> the database.
>
> 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.
>
> Is there any option to check if the load is successful or not, without
> going through the logs?
>
>
> PostgreSQL 10.15 (Ubuntu 10.15-0ubuntu0.18.04.1)
>
> postgres=# select pg_reload_conf();
> pg_reload_conf
> ----------------
> t
>
>
> In logs below error was reported:
>
> line 45 of configuration file ""/******************/pg_hba.conf"""
> LOG,00000,"pg_hba.conf was not reloaded",,,,,,,,"SIGHUP_handler,
> postmaster.c:2642","" \
>
>
>
> Thanks & Regards,
> Rajamohan.J
> Mobile : +91 8098167651, +91 7259157485
> Email:garajamohan@gmail.com
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
@ 2021-02-05 06:11 Tom Lane <tgl@sss.pgh.pa.us>
parent: RAJAMOHAN <garajamohan@gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Tom Lane @ 2021-02-05 06:11 UTC (permalink / raw)
To: RAJAMOHAN <garajamohan@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org
RAJAMOHAN <garajamohan@gmail.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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
@ 2021-02-05 06:32 David G. Johnston <david.g.johnston@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: David G. Johnston @ 2021-02-05 06:32 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: RAJAMOHAN <garajamohan@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Thursday, February 4, 2021, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> RAJAMOHAN <garajamohan@gmail.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.)
>
My and Heikki’s recent changes to address this are only in head, not v13 or
earlier.
David J.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: SELECT pg_reload_conf(); returning true despite hba file loading was failed
@ 2021-02-05 06:40 RAJAMOHAN <garajamohan@gmail.com>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: RAJAMOHAN @ 2021-02-05 06:40 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Thanks Tom.
pg_hba_file_rules view will be helpful.
Thanks & Regards,
Rajamohan.J
Oracle DBA / Postgresql DBA
Mobile : +91 8098167651, +91 7259157485
Email:garajamohan@gmail.com
On Fri, Feb 5, 2021 at 12:02 PM David G. Johnston <
david.g.johnston@gmail.com> wrote:
>
> On Thursday, February 4, 2021, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> RAJAMOHAN <garajamohan@gmail.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.)
>>
>
> My and Heikki’s recent changes to address this are only in head, not v13
> or earlier.
>
> David J.
>
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2021-02-05 06:40 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 05:59 SELECT pg_reload_conf(); returning true despite hba file loading was failed RAJAMOHAN <garajamohan@gmail.com>
2021-02-05 06:08 ` Raj kumar <rajkumar820999@gmail.com>
2021-02-05 06:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-02-05 06:32 ` David G. Johnston <david.g.johnston@gmail.com>
2021-02-05 06:40 ` RAJAMOHAN <garajamohan@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox