Re: Could you teach me, How can we specify password when using psql....

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: 노현석 <noh019(at)naver(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Could you teach me, How can we specify password when using psql....
Date: 2010-08-06 13:49:50
Message-ID: 17897.1281102590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Fetter <david(at)fetter(dot)org> writes:
> On Fri, Aug 06, 2010 at 01:35:58PM +0900, wrote:
>> when using oracle sqlplus.. we can specify password.
>> $ sqlplus system/manager
>>
>> Could you teach me, How can we specify password when using psql....
>> $ psql -p 5432 -h rac2 -d mydb -U hsnoh
>> Password for user hsnoh:

> Overall, it's better to use a .pgpass (pgpass.conf on Windows)

The reason why psql doesn't have that is that putting a password
directly on the command line is a security hole: any other process
on the machine can see psql's command line, on most platforms.

It's a security hole for Oracle, too --- you shouldn't be doing
things that way.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-08-06 13:59:25 Re:
Previous Message Torsten Zühlsdorff 2010-08-06 13:13:32 Re: MySQL versus Postgres