Re: psql from Linux script - Mailing list pgsql-general

From Devrim GUNDUZ
Subject Re: psql from Linux script
Date
Msg-id Pine.LNX.4.63.0508301127420.6429@emo.org.tr
Whole thread Raw
In response to Re: psql from Linux script  (Marko Kreen <marko@l-t.ee>)
List pgsql-general
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--8323328-1690527636-1125390591=:6429
Content-Type: TEXT/PLAIN; charset=iso-8859-9; format=flowed
Content-Transfer-Encoding: 8BIT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Tue, 30 Aug 2005, Marko Kreen wrote:

>> 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.

Yes, this should be rewritten as:

echo "ALTER USER postgres WITH PASSWORD 'newpassword';" |su -l \
postgres -c "psql template1"

Regards,
- --
Devrim GUNDUZ
Kivi Bilişim Teknolojileri - http://www.kivi.com.tr
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                      http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFDFBkBtl86P3SPfQ4RApBiAKDJY0HlXZSExl+9zXv1Q/bUL6tQAgCbBnBZ
vUxKGhAVOAFA2ia9OsBxdHc=
=1zxD
-----END PGP SIGNATURE-----
--8323328-1690527636-1125390591=:6429--

pgsql-general by date:

Previous
From: Marko Kreen
Date:
Subject: Re: psql from Linux script
Next
From: Patrick.FICHE@AQSACOM.COM
Date:
Subject: Re: psql from Linux script