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

From: Iñigo Barandiaran <ibarandiaran(at)vicomtech(dot)org>
To: rod(at)iol(dot)ie, Sam Mason <sam(at)samason(dot)me(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: createdb.exe and psql.exe without Promting Password
Date: 2009-02-11 07:54:40
Message-ID: 49928440.8000300@vicomtech.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you all!

and Thanks Sam for the explanation about environment variable. I didn't
know about that :)

I've also tried the option of .pgpass file, that as far as I understand
in Windows is pgpass.conf. I did a file containing only this line

/*/:/*///:/*///:/MyPostgres///User/:MyPostgres://Password

/I put this file in:
c:\MyPosgreInstalation and
c:\MyPosgreInstalation\bin and
c:\MyPosgreInstalation\data and
C:\Documents and Settings\postgres\Application Data\

all without success. What I'm doing wrong? When I try to execute createdb.exe -T template0 -U MyPostgres MyDataBase always ask for password.

I'm running Windows XP 32 bit.

Thanks in advance for your support.

Best,

> On 10/02/2009 21:47, Sam Mason wrote:
>
>> On Tue, Feb 10, 2009 at 07:22:24PM +0100, IIIigo Barandiaran wrote:
>>
>>> What does "visible to the script" means?
>>>
>> Each command interpreter has its own set of variables; you need to set
>> them in the correct one. For example, starting one copy of "cmd" and
>> typing "SET var=value" and then closing it and starting another one and
>> running your "script" won't work because they are different interpreters
>> (i.e. different instances, or processes, of the same executable, or
>> program).
>>
>> If you're executing "SET ..." in one command interpreter and then double
>> clicking on your script (a .bat file?) then you're effectively starting
>> another interpreter on that one script, it will exit when it's reached
>> the end of your script.
>>
>
> I couldn't have put it better! :-) You could create a system-wide
> environment variable via right-clicking on My Computer, selecting
> properties, then clicking "Environment variables" - but this is a
> *really* bad idea for storing a password, as it's visible to anyone
> using the computer. Far better to use the .pgpass file.
>
> 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 Russell Hltn 2009-02-11 08:15:02 Difference between Windows pgsql and Linux pgsql?
Previous Message Scott Marlowe 2009-02-11 07:48:20 Re: Key Vs Index