Skip site navigation (1) Skip section navigation (2)

Re: LINE COMMAND

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Felipe Lopes <felipelopess(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: LINE COMMAND
Date: 2010-08-16 14:59:47
Message-ID: 4649.1281970787@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Felipe Lopes <felipelopess(at)gmail(dot)com> writes:
> I would like to run a line command (psql) with the supplied password without
> pausing the command, but this option is not available:

> psql --username=root --password=root my_bd < "script.sql"

This is intentionally not supported.  If it were supported it would be
insecure.  On most operating systems, every process in the machine can
see whatever is on the command line of every other process ... including
your password, if you were doing something like the above.

The recommended solution if you don't want to key in the password
separately is to use a .pgpass file.  See
http://www.postgresql.org/docs/8.4/static/libpq-pgpass.html

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-08-16 15:30:43
Subject: Re: Re: BUG #5614: Varchar column (with DEFAULT NULL) stores 'UL' value instead of null
Previous:From: Felipe LopesDate: 2010-08-16 14:49:01
Subject: Re: LINE COMMAND

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group