Re: psql in shell

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: rx <rong(dot)xie(at)stud(dot)tu-muenchen(dot)de>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql in shell
Date: 2003-04-07 17:29:58
Message-ID: 20030407102328.C35893-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support pgsql-docs pgsql-general

On Fri, 4 Apr 2003, rx wrote:

(This really didn't need to go to all those lists/people, so replying to
general only)

> Can you help me for my another question?

> But when I execute it with "where-condition" in shell as under, come a Error.
>
> PS: VEIrx is database name. Faxeingang is table name. Filename is column name.
>
> TuxFax:~ # echo 'select * from "Faxeingang" where "Filename"=ddf.tif;'|psql VEIrx -U postgres
>
> ERROR: Relation "ddf" does not exist

Right because that's select * from "Faxeingang" where "Filename" =
ddf.tif; (ie, a reference to a tif column of a table named ddf)

> TuxFax:~ # echo 'select * from "Faxeingang" where "Filename"='ddf.tif';'|psql VEIrx -U postgres
>
> ERROR: Relation "ddf" does not exist

This is probably the same as the above (run just the echo part in your
shell).

> TuxFax:~ # echo 'select * from "Faxeingang" where "Filename"="ddf.tif";'|psql VEIrx -U postgres
>
> ERROR: Attribute 'ddf.tif' not found

This is select * from "Faxeingang" where "Filename" = "ddf.tif"
(ie, a reference to a column named ddf.tif in Faxeingang.

How about something like:

echo "select * from \"Faxeingang\" where \"Filename\"='ddf.tif';"

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Jan Wieck 2003-04-07 18:22:42 Re: [GENERAL] psql in shell
Previous Message Dave Page 2003-04-06 17:32:53 Re: Question send modification

Browse pgadmin-support by date

  From Date Subject
Next Message Manfred Koizar 2003-04-07 17:53:45 Re: [GENERAL]
Previous Message Lin Jianfong 2003-04-06 22:59:14 Re: Problem connecting to PostgreSQL 7.3 using pgAdmin II v1.4

Browse pgsql-docs by date

  From Date Subject
Next Message Manfred Koizar 2003-04-07 17:53:45 Re: [GENERAL]
Previous Message Peter Eisentraut 2003-04-04 16:47:21 Re: sgmltools don't work here

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2003-04-07 17:53:45 Re: [GENERAL]
Previous Message ck388 2003-04-07 17:20:58 Does Postgresql 7.2.1 support connection pooling?