Re: createdb.exe and psql.exe without Promting Password

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Inigo Barandiaran <ibarandiaran(at)vicomtech(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: createdb.exe and psql.exe without Promting Password
Date: 2009-02-10 18:11:40
Message-ID: 4991C35C.1010907@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/02/2009 18:04, Inigo Barandiaran wrote:

> I would like to create an script that includes calls to createdb.exe and
> psql.exe. I would like to use them with a user but without asking or
> prompting for pasword. For example:
> createdb.exe -T template0 -U MyPosgresUser MyDataBaseName.
>
> I've read that if I define an environment variable like SET
> PGPPASSWORD=MyPosgresUserPassword, both calls dont ask for password. I've
> tested this variable in different platforms and does not work.
> Do you know how so solve it?

What platform(s) did you test it on? Are you sure that the environment
variable was visible to the script?

Another option is to use a .pgpass file:

http://www.postgresql.org/docs/8.3/static/libpq-pgpass.html

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Iñigo Barandiaran 2009-02-10 18:22:24 Re: createdb.exe and psql.exe without Promting Password
Previous Message Richard Huxton 2009-02-10 18:10:51 Re: createdb.exe and psql.exe without Promting Password