X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8216411F6CF3 for ; Mon, 24 Apr 2006 15:17:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 54364-01-6 for ; Mon, 24 Apr 2006 15:17:29 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id C2CC611F6245 for ; Mon, 24 Apr 2006 09:31:41 -0300 (ADT) Received: by nproxy.gmail.com with SMTP id c31so754870nfb for ; Mon, 24 Apr 2006 05:31:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=qP0BKWs/GDl4H2Ej/NSZFQiJAjHhYd4bWPHLI2RiJ/jdFP2F7sR6B0Th2VXn/MYu0pz0rNpqYyJUMk49w+ta0N1cFzNqIr42Pdw6xCfqQsehwSL4vk31WHsgYKsmdE27nWSXak1ZSia7w51zxs3VwcvjMqYacWacYYFATrvHtCg= Received: by 10.49.94.18 with SMTP id w18mr2582602nfl; Mon, 24 Apr 2006 05:31:40 -0700 (PDT) Received: by 10.48.163.5 with HTTP; Mon, 24 Apr 2006 05:31:40 -0700 (PDT) Message-ID: Date: Mon, 24 Apr 2006 20:31:40 +0800 From: JSP To: "dhanesh.prabha@wipro.com" Subject: Re: Problem with /usr/local/pgsql/bin/psql Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11448_21324934.1145881900386" References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/243 X-Sequence-Number: 21412 ------=_Part_11448_21324934.1145881900386 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline have you tried using double quotes on your command instead of that single quote... ex. psql -c "insert into table values('a', 'b')" On 4/19/06, dhanesh.prabha@wipro.com wrote: > > Hi , > > I am trying to insert data into the table via shell script using psql > command. > But it giving syntax error. the same query is finely working pgAdmin > III client. > The query and error given below. > > Eg: > /usr/local/pgsql/bin/psql -d temp -c 'insert into > temp.ip_mapping_tb(ip,location) values('192.100.9.51','FirstFloor')' > > ERROR: syntax error at or near ".9" at character 85 > LINE 1: ...pping_tb(ip,location) values(192.100.9.51,Firs... > > Also when i am givinf Firstfloor as First Floor it was giving > error > > /usr/local/pgsql/bin/psql -d temp -c 'insert into > temp.ip_mapping_tb(ip,location) values('192.100.9.51','First Floor')' > > psql: FATAL: role "Floor)" does not exist > > > > > > Thanks and Regards > > Dhanesh > > > The information contained in this electronic message and any attachments > to this message are intended for the exclusive use of the addressee(s) an= d > may contain proprietary, confidential or privileged information. If you a= re > not the intended recipient, you should not disseminate, distribute or cop= y > this e-mail. Please notify the sender immediately and destroy all copies = of > this message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. = The > company accepts no liability for any damage caused by any virus transmitt= ed > by this email. > > www.wipro.com > -- "The trouble with the rat race is that even if you win, you're still a rat.= " --- Lily Tomlin ------=_Part_11448_21324934.1145881900386 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
have you tried using double quotes on your command instead of that single q= uote...

ex. psql -c "insert into table values('a', 'b')"

On 4/19/06, dhanesh.prabha@wipro.com <<= a href=3D"mailto:dhanesh.prabha@wipro.com"> dhanesh.prabha@wipro.com> wrote:
Hi ,
 
    I am trying to insert data into the table via shell script using psql command.
    But it giving syntax error. the same query is finely working pgAdmin III client.
    The query and error given below.
 
    Eg:
     &n= bsp;  /usr/local/pgsql/bin/psql -d temp -c 'insert into temp.ip_mapping_tb(ip,location)  values('192.100.9.51','FirstFloor')'
 
     &n= bsp;  ERROR:  syntax error at or near ".9" at character 85
        LINE 1: ...pping_tb(ip,location)  values(192.1= 00.9.51,Firs...
 
     &n= bsp;  Also when i am givinf Firstfloor as First Floor it was giving error
 
     &n= bsp;  /usr/local/pgsql/bin/psql -d temp -c 'insert into temp.ip_mapping_tb(ip,location)  values('192.100.9.51','First Floor')'
 
     &n= bsp;  psql: FATAL:  role "Floor)" does not exist

 

     &nbs= p; 

Thanks and Regards

Dhanesh

 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com



--


"The= trouble with the rat race is that even if you win, you're still a rat.&quo= t; --- Lily Tomlin ------=_Part_11448_21324934.1145881900386--