Re: [GENERAL] psql in shell

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: rx <rong(dot)xie(at)stud(dot)tu-muenchen(dot)de>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>, pgadmin-support(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, pgsql-general-owner(at)postgresql(dot)org
Subject: Re: [GENERAL] psql in shell
Date: 2003-04-07 18:22:42
Message-ID: 3E91C1F2.B7F20BF4@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support pgsql-docs pgsql-general

What about \' ?!?

BTW, some of the attempts are at least funny.

Jan

> rx wrote:
>
> 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(at)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

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message efesar 2003-04-07 22:07:37 PGA3 Query Builder Files
Previous Message Stephan Szabo 2003-04-07 17:29:58 Re: psql in shell

Browse pgadmin-support by date

  From Date Subject
Next Message Didrik Pinte 2003-04-09 16:03:53 database migration wizard question
Previous Message Manfred Koizar 2003-04-07 17:53:45 Re: [GENERAL]

Browse pgsql-docs by date

  From Date Subject
Next Message Corey Scott 2003-04-08 09:03:48 PostgreSQL User Manual
Previous Message Manfred Koizar 2003-04-07 17:53:45 Re: [GENERAL]

Browse pgsql-general by date

  From Date Subject
Next Message Roberto de Amorim 2003-04-07 18:25:31 Indexes intersection
Previous Message Manfred Koizar 2003-04-07 18:05:20 Re: Problem to manage OID on the space disk