Thread: psql commandline

psql commandline

From
digit-x@gmx.net
Date:
Hi list

the following commandline query doesn`t work.....
why? please help

su - postgres -c 'psql --dbname database --command "UPDATE users SET
pin=12345 WHERE login='admin';"'


--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse f�r Mail, Message, More +++

Re: psql commandline

From
"Charley L. Tiggs"
Date:
On Aug 31, 2005, at 7:14 AM, digit-x@gmx.net wrote:

> Hi list
>
> the following commandline query doesn`t work.....
> why? please help
>
> su - postgres -c 'psql --dbname database --command "UPDATE users SET
> pin=12345 WHERE login='admin';"'

Here's easier syntax that you can use to execute your query from the
command line:

psql -c "UPDATE users SET pin=12345 WHERE login='admin'" database
postgres