Re: psql in shell - Mailing list pgsql-general

From Stephan Szabo
Subject Re: psql in shell
Date
Msg-id 20030407102328.C35893-100000@megazone23.bigpanda.com
Whole thread Raw
In response to psql in shell  ("rx" <rong.xie@stud.tu-muenchen.de>)
List 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';"


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: RelationBuildDesc Notice (corrupt DB?)
Next
From: Manfred Koizar
Date:
Subject: Re: Problem to manage OID on the space disk