psql in shell - Mailing list pgsql-general

From rx
Subject psql in shell
Date
Msg-id 005e01c2faa5$a31056a0$16e1f48a@IPSM7N
Whole thread Raw
Responses Re: psql in shell  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
 hallo,
 
Can you help me for my another question?
 
It work good as under in shell without "where-condition" .

TuxFax:~ # echo 'select * from "Faxeingang";'|psql VEIrx -U postgres

PS: VEIrx is database name. Faxeingang is table name.  In SuSE Linux 8.0, bash, postgreSQL7.2.2

DatumFaxeingang | Filename | CSID

------------------------+-------------------------+-----------

2003-04-03 17:30:45+02 | 2003_04_03_17_30_45.tif | Fax

2003-04-04 10:01:01+02 | df.tif | ds

2003-04-04 10:01:04+02 | ddf.tif | aa

(36 rows)

TuxFax:~ #

 

It work good as under in psql with "where-condition" .

PS: VEIrx is database name. Faxeingang is table name.  Filename is column name.

postgres@TuxFax:/root> psql VEIrx

Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms

\h for help with SQL commands

\? for help on internal slash commands

\g or terminate with semicolon to execute query

\q to quit

VEIrx=# select * from "Faxeingang" where "Filename"='ddf.tif';

DatumFaxeingang | Filename | CSID

------------------------+----------+------

2003-04-04 10:01:04+02 | ddf.tif | aa

(1 row)

 

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

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

ERROR: Relation "ddf" does not exist

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

ERROR: Attribute 'ddf.tif' not found

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

ERROR: Attribute 'ddf.tif' not found

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

ERROR: zero-length delimited identifier

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

ERROR: Relation "ddf" does not exist

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

ERROR: parser: parse error at or near ";"

TuxFax:~ # echo 'select * from "Faxeingang" where "Filename"=/ddf.tif/'|psql VEIrx -U postgres

ERROR: parser: parse error at or near ""

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

ERROR: parser: parse error at or near ";"

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

ERROR: parser: parse error at or near ";"

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

ERROR: Attribute '/ddf.tif/' not found

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

invalid command \"ddf.tif"

ERROR: parser: parse error at or near ""

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

invalid command \"ddf.tif

ERROR: parser: parse error at or near ""

TuxFax:~ # echo "select * from "Faxeingang" where "Filename"=\"ddf.tif\";"|psql VEIrx -U postgres

ERROR: Relation "faxeingang" does not exist

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

ERROR: Attribute 'ddf.tif/' not found

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

ERROR: parser: parse error at or near ";"

TuxFax:~ #

 

thank you very much for your Help!

best regards!
rong

pgsql-general by date:

Previous
From: nolan@celery.tssi.com
Date:
Subject: Generating consecutive sequence values
Next
From: "abremond@voila.fr"
Date:
Subject: Problem to manage OID on the space disk