Re: psql commandline

From: "Charley L(dot) Tiggs" <ctiggs(at)xpressdocs(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: psql commandline
Date: 2005-08-31 14:27:22
Message-ID: 8710B74B-8EC1-4C24-8F63-6F1F5B88BADB@xpressdocs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql


On Aug 31, 2005, at 7:14 AM, digit-x(at)gmx(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-08-31 18:04:29 Re: Sorting Challenge
Previous Message Kenneth Gonsalves 2005-08-31 13:29:59 Re: psql commandline

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-08-31 14:29:49 Re: [SQL] How do I copy part of table from db1 to db2 (and
Previous Message Kenneth Gonsalves 2005-08-31 13:29:59 Re: psql commandline