X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 15AA84762F1 for ; Mon, 7 Apr 2003 13:30:44 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 93FCA47610C for ; Mon, 7 Apr 2003 13:30:07 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 38A9FD62C; Mon, 7 Apr 2003 10:30:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 264D65C0B; Mon, 7 Apr 2003 10:30:00 -0700 (PDT) Date: Mon, 7 Apr 2003 10:29:58 -0700 (PDT) From: Stephan Szabo To: rx Cc: Subject: Re: psql in shell In-Reply-To: <005e01c2faa5$a31056a0$16e1f48a@IPSM7N> Message-ID: <20030407102328.C35893-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-16.1 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/455 X-Sequence-Number: 40520 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';"