Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfB0-0007CZ-H0 for pgsql-admin@arkaria.postgresql.org; Wed, 27 Aug 2014 15:30:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XMfAz-0005uw-U7 for pgsql-admin@arkaria.postgresql.org; Wed, 27 Aug 2014 15:30:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XMfAy-0005uo-OH for pgsql-admin@postgresql.org; Wed, 27 Aug 2014 15:30:20 +0000 Received: from mail.journyx.com ([209.163.206.41] helo=mail.int.journyx.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfAk-0004AG-6N for pgsql-admin@postgresql.org; Wed, 27 Aug 2014 15:30:19 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.int.journyx.com (Postfix) with ESMTP id 2DB2331D13D; Wed, 27 Aug 2014 10:30:04 -0500 (CDT) Received: from mail.int.journyx.com ([127.0.0.1]) by localhost (mail.int.journyx.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id MP4AeXIvDChq; Wed, 27 Aug 2014 10:30:04 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.int.journyx.com (Postfix) with ESMTP id F2DD931D148; Wed, 27 Aug 2014 10:30:03 -0500 (CDT) X-Amavis-Modified: Mail body modified (using disclaimer) - mail.int.journyx.com X-Virus-Scanned: amavisd-new at mail.int.journyx.com Received: from mail.int.journyx.com ([127.0.0.1]) by localhost (mail.int.journyx.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id J9dR27CDf-Jo; Wed, 27 Aug 2014 10:30:03 -0500 (CDT) Received: from mail.int.journyx.com (zimbra.int.journyx.com [192.168.100.5]) by mail.int.journyx.com (Postfix) with ESMTP id B51FF31D13D; Wed, 27 Aug 2014 10:30:03 -0500 (CDT) Date: Wed, 27 Aug 2014 10:30:03 -0500 (CDT) From: Scott Whitney Reply-To: Scott Whitney To: czezz Cc: pgsql-admin@postgresql.org Message-ID: <1040409514.1017500.1409153403592.JavaMail.zimbra@mail.int.journyx.com> In-Reply-To: <50235644.468fa51b.53fdf382.a46b@o2.pl> References: <50235644.468fa51b.53fdf382.a46b@o2.pl> Subject: Re: SQL statement form shell ? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1017499_677515244.1409153403589" X-Mailer: Zimbra 8.0.7_GA_6021 (ZimbraWebClient - GC36 (Win)/8.0.7_GA_6021) Thread-Topic: SQL statement form shell ? Thread-Index: e5OQawEetEnScF+etAJYFCUSMuyxCA== X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org ------=_Part_1017499_677515244.1409153403589 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit There are a few things I would check. a) psql -p 5472 -d fm_db_Server4 b) SELECT * from foo2; c) Do those _2_ statements work separately? That should prove that you're talking to the exact same connection/host/port you expect. d) psql -p 5472 -d fm_db_Server4 -c "SELECT * FROM foo2; So, step a&b succeed, but step d fails? d) psql -p 5472 -d fm_db_Server4 e) SELECT * from "foo2"; If this doesn't work, "foo2," is not a valid relation. It's case-sensitive or some such. Once you can make the table name work within " " marks, THEN try from the command prompt like: f) psql -p 5472 -d fm_db_Server4 -c "SELECT * FROM \"foo2\" ; " ----- Original Message ----- > Im trying to execute simple query in shell. > This query works OK in PSQL client: > Server4=# SELECT * FROM foo2; > However, for some reason I cannot execute it in shell. I try it like > following: > -bash-4.1$ psql -p 5472 -d fm_db_Server4 -c "SELECT * FROM foo2;" > ERROR: relation "foo2" does not exist > LINE 1: SELECT * FROM foo2; > ^ > Any ideas what Im doing wrong ? > BR, > czezz > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin Journyx, Inc. 7600 Burnet Road #300 Austin, TX 78757 www.journyx.com p 512.834.8888 f 512.834.8858 Do you receive our promotional emails? You can subscribe or unsubscribe to those emails at http://go.journyx.com/emailPreference/e/4932/714 ------=_Part_1017499_677515244.1409153403589 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
There are a few things I would c= heck.

a) psql -p 5472 -d fm_db_Server4
b) SELECT * fr= om foo2;
c) Do those _2_ statements work separately? That should = prove that you're talking to the exact same connection/host/port you expect= .
d) psql -p 5= 472 -d fm_db_Server4 -c "SELECT * FROM foo2;

So, step a&b succeed, but step d fails?

d)&n= bsp;psql -p 5472 -d fm_db_Ser= ver4
e) SELECT * from "foo2";

If this doesn't work,= "foo2," is not a valid relation. It's case-sensitive or some such. Once yo= u can make the table name work within " " marks, THEN try from the command = prompt like:

f) psql -p 5472 -d fm_db_Server4 -c "SELECT * FROM \"foo2\" ;= "



ERROR:  relation "foo2" does not exist
LINE 1: SELECT * FROM= foo2;
                 &nb= sp;    ^

Any ideas what Im doing wrong ?

BR,
czezz


--
Sent via pgsql-admin = mailing list (pgsql-admin@postgresql.org)
To make changes to your subscr= iption:
http://www.postgresql.org/mailpref/pgsql-admin
<= div>

=


Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com

p 512.834.8888 
f 512-834-8858 

Do you receive our promotional emails? You can subscribe or unsubscribe to those emails here. 

=0A
= ------=_Part_1017499_677515244.1409153403589--