Re: psql from Linux script

From: Patrick(dot)FICHE(at)AQSACOM(dot)COM
To: bht(at)actrix(dot)gen(dot)nz, pgsql-general(at)postgresql(dot)org
Subject: Re: psql from Linux script
Date: 2005-08-30 08:44:05
Message-ID: 1DC6C8C88D09D51181A40002A5286929B2369F@intranet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Bernard,

I just ran a test on Solaris...
The following syntax is working for me :

su - postgres -c "psql template1 -U postgres -c \"ALTER USER postgres WITH
PASSWORD 'newpassword';\""

If it can help you...

----------------------------------------------------------------------------
---------------
Patrick Fiche
email : patrick(dot)fiche(at)aqsacom(dot)com
tel : 01 69 29 36 18
----------------------------------------------------------------------------
---------------

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Bernard
Sent: mardi 30 aout 2005 09:05
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] psql from Linux script

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"

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
#

The client authentication configuration file pg_hba.conf is in its
original state.

I would appreciate your help very much.

Thanks.

Bernard

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Browse pgsql-general by date

  From Date Subject
Next Message Bernard 2005-08-30 09:25:07 Re: psql from Linux script
Previous Message Devrim GUNDUZ 2005-08-30 08:29:51 Re: psql from Linux script