public inbox for [email protected]
help / color / mirror / Atom feedpsql in shell
3+ messages / 3 participants
[nested] [flat]
* psql in shell
@ 2003-04-04 12:28 rx <[email protected]>
2003-04-07 17:29 ` Re: psql in shell Stephan Szabo <[email protected]>
2003-04-07 18:22 ` Re: [GENERAL] psql in shell Jan Wieck <[email protected]>
0 siblings, 2 replies; 3+ messages in thread
From: rx @ 2003-04-04 12:28 UTC (permalink / raw)
To: pgadmin-hackers <[email protected]>; [email protected]; pgsql-docs; [email protected]; [email protected]
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: psql in shell
2003-04-04 12:28 psql in shell rx <[email protected]>
@ 2003-04-07 17:29 ` Stephan Szabo <[email protected]>
1 sibling, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2003-04-07 17:29 UTC (permalink / raw)
To: rx <[email protected]>; +Cc: [email protected]
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';"
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [GENERAL] psql in shell
2003-04-04 12:28 psql in shell rx <[email protected]>
@ 2003-04-07 18:22 ` Jan Wieck <[email protected]>
1 sibling, 0 replies; 3+ messages in thread
From: Jan Wieck @ 2003-04-07 18:22 UTC (permalink / raw)
To: rx <[email protected]>; +Cc: pgadmin-hackers <[email protected]>; [email protected]; pgsql-docs; [email protected]; [email protected]
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@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. #
#================================================== [email protected] #
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-04-07 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 12:28 psql in shell rx <[email protected]>
2003-04-07 17:29 ` Stephan Szabo <[email protected]>
2003-04-07 18:22 ` Jan Wieck <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox