On 20/07/14 03:20 PM, Guillaume Lelarge wrote:
2014-07-20 23:15 GMT+02:00 Scott Furry <scott.wl.fu...@gmail.com <mailto:scott.wl.fu...@gmail.com>>:


    On 20/07/14 02:45 PM, Guillaume Lelarge wrote:

        2014-07-19 18:11 GMT+02:00 Scott Furry
        <scott.wl.fu...@gmail.com <mailto:scott.wl.fu...@gmail.com>
        <mailto:scott.wl.fu...@gmail.com
        <mailto:scott.wl.fu...@gmail.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




--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support

Reply via email to