Re: Questions on PostGreSQL Authentication mechanism...

From: dipti shah <shahdipti1980(at)gmail(dot)com>
To: postgres(at)tbruce(dot)com
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Questions on PostGreSQL Authentication mechanism...
Date: 2010-02-03 06:28:16
Message-ID: d5b05a951002022228g7ec6d907r28aada89d9dec52d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am connected to database as postgres user.

'\!exec ..' doesn't work if I connect to the database from other host but it
does work if I connect to the database from server where I have PostGreSQL
installed. pg_read_file doesn't work in any case.

Techdb=# \! exec cat /etc/postgresql/8.4/main/pg_hba.conf
cat: cannot open /etc/postgresql/8.4/main/pg_hba.conf
Techdb=# select pg_read_file('pg_hba.conf', 0, 8192);
ERROR: could not open file "pg_hba.conf" for reading: No such file or
directory
Thanks,
Dipti

On Wed, Feb 3, 2010 at 12:14 AM, Tim Bruce - Postgres
<postgres(at)tbruce(dot)com>wrote:

> On Tue, February 2, 2010 08:23, Alvaro Herrera wrote:
> > dipti shah escribió:
> >> Techdb=# show hba_file;
> >> hba_file
> >> --------------------------------------
> >> /etc/postgresql/8.4/main/pg_hba.conf
> >> (1 row)
> >>
> >> Moreover, is there anyway to view content of this file from stored in
> >> above
> >> location "Techdb" command prompt itself.
> >>
> >> Techdb=# cat /etc/postgresql/8.4/main/pg_hba.conf;
> >
> > Probably pg_read_file():
> >
> > select pg_read_file('pg_hba.conf', 0, 8192);
> >
> > Note that pg_read_file only allows paths relative to $PGDATA, which is
> > what you get from SHOW data_directory;
> >
> > --
> > Alvaro Herrera
> > http://www.CommandPrompt.com/ <http://www.commandprompt.com/>
> > PostgreSQL Replication, Consulting, Custom Development, 24x7 support
> >
> > --
> > Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-general
> >
>
> Since the pg_hba.conf file is located in the /etc path, the pg_read_file
> command fails with an error of
>
> "could not open file "pg_hba.conf" for reading: No such file or direcotry"
>
> It also won't allow use of the absolute path.
>
> The answer I found was to use the following command:
>
> postgres=# \! exec cat /etc/postgresql/8.3/main/pg_hba.conf
>
> Tim
> --
> Timothy J. Bruce
>
> Registered Linux User #325725
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-02-03 06:38:39 Re: Questions on PostGreSQL Authentication mechanism...
Previous Message Johan Nel 2010-02-03 05:32:06 Re: add column specify position