Re: psql commandline

From: Zac <zaccheob(at)inwind(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: psql commandline
Date: 2005-08-31 13:19:39
Message-ID: df4alh$19dk$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Be quiet... it is not a db problem: your shell interprets "'" characters
before sending them to psql so your query becomes
UPDATE users SET pin=12345 WHERE login=admin;
and column admin (not the literal 'admin') doesn't really exist!
Try this:
su - postgres -c "psql --dbname database --command \"UPDATE users SET
pin=12345 WHERE login='admin';\""

> The error is :
>
> column "admin" doesn`t exist
>
> What the f... is that db doing?
>
>
>
>>--- Ursprüngliche Nachricht ---
>>Von: Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>
>>An: pgsql-sql(at)postgresql(dot)org
>>Betreff: Re: [SQL] psql commandline
>>Datum: Wed, 31 Aug 2005 18:13:18 +0530
>>
>>On Wednesday 31 Aug 2005 6:00 pm, dIGITx wrote:
>>
>>>su - postgres -c 'psql --dbname database --command "UPDATE users
>>>SET pin=12345 WHERE login='admin';"'
>>
>>works for me - what is the error you are getting?
>>
>>--
>>regards
>>kg
>>
>>http://www.livejournal.com/users/lawgon
>>tally ho! http://avsap.org.in
>>ಇಂಡà³à²²à²¿à²¨à²•à³à²¸ வாழà¯à®•!
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 6: explain analyze is your friend
>
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Kenneth Gonsalves 2005-08-31 13:25:25 Re: psql commandline
Previous Message digit-x 2005-08-31 13:13:59 Re: psql commandline

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2005-08-31 13:25:25 Re: psql commandline
Previous Message Greg Sabino Mullane 2005-08-31 13:19:00 Re: How do I copy part of table from db1 to db2 (and rename the columns)?