Re: psql from Linux script

From: Marko Kreen <marko(at)l-t(dot)ee>
To: Bernard <bht(at)actrix(dot)gen(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: psql from Linux script
Date: 2005-08-30 08:10:10
Message-ID: 20050830081010.GA18410@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 30, 2005 at 07:04:52PM +1200, Bernard wrote:
> Dear Postgresql Specialists
>
> I am failing to update the password of the postgresql user from within
> a Linux installation script run by root:
>
> # su - postgres -c echo "ALTER USER postgres WITH PASSWORD
> 'newpassword';" | psql -U postgres template1
> psql: FATAL: Ident authentication failed for user "postgres"

I do not think the psql is ran as user postgres.

>
> In contrast, there is no problem with the same command issued in psql
> interactively:
>
> # su postgres
> $ psql template1
> template1=# ALTER USER postgres WITH PASSWORD 'newpassword';
> ALTER USER
> \q
> $ exit
> #

--
marko

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2005-08-30 08:14:04 temp_buffers
Previous Message Bernard 2005-08-30 07:04:52 psql from Linux script