Re: pg_hba.conf editing question

From: Scott Furry <scott(dot)wl(dot)furry(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Re: pg_hba.conf editing question
Date: 2014-07-20 21:40:32
Message-ID: 53CC3750.1020100@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support


On 20/07/14 03:20 PM, Guillaume Lelarge wrote:
> 2014-07-20 23:15 GMT+02:00 Scott Furry <scott(dot)wl(dot)furry(at)gmail(dot)com
> <mailto:scott(dot)wl(dot)furry(at)gmail(dot)com>>:
>
>
> On 20/07/14 02:45 PM, Guillaume Lelarge wrote:
>
> 2014-07-19 18:11 GMT+02:00 Scott Furry
> <scott(dot)wl(dot)furry(at)gmail(dot)com <mailto:scott(dot)wl(dot)furry(at)gmail(dot)com>
> <mailto:scott(dot)wl(dot)furry(at)gmail(dot)com
> <mailto:scott(dot)wl(dot)furry(at)gmail(dot)com>>>:
> In the file pgadmin/frm/frmHbaConfig.cpp, the pg_hba.conf edit
> form constructor appears to get the absolute path to the
> configuration file and stores this value in "serverFileName"
> ("SHOW hba_file"). The value is then used to few lines
> down in a
> call to "SELECT pg_file_read(...)".
> No magic. pg_file_read() calls pg_read_file. Here is the main
> comment of this function:
>
> So the path may be absolute but, in such a case, it must
> contain the data directory.
>
>
> I'm using the postgres account and the "SELECT pg_file_read"
> command fails if I try to take into account the data directory.
> Using:
> SELECT * from
> pg_read_file('../../../../../etc/postgresql/9.3/main/pg_hba.conf');
> will return the error:
> ERROR: path must be in or below the current directory
>
> Yet this sequence of commands works for pgAdmin?
>
> I'm pretty sure it doesn't.
Apologies...I wasn't paying attention to what I was posting.

I'm just trying to understand how the pg_hba.conf file can be read in
pgAdmin.

I've tried variations to emulate the SQL commands used in pgAdmin to no
avail. I'm using postgres db and postgres account to connect with the
localhost via psql. Absolute path...Relative path...nothing seems to
work. Yet, pgAdmin (in the HbaConfig.cpp file) can grab the absolute
path of a config file ("SHOW hba_file") then call "SELECT
pg_file_read()" and doesn't return an error.

If there is no special setup, then how can this fail on the command line
yet work in pgAdmin?
What obvious thing am I missing here?
Scott

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Scott Furry 2014-07-21 14:54:20 Re: pg_hba.conf editing question
Previous Message Guillaume Lelarge 2014-07-20 21:20:35 Re: pg_hba.conf editing question