pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem with /usr/local/pgsql/bin/psql
5+ messages / 4 participants
[nested] [flat]
* Problem with /usr/local/pgsql/bin/psql
@ 2006-04-19 10:01 dhanesh.prabha@wipro.com
0 siblings, 2 replies; 5+ messages in thread
From: dhanesh.prabha@wipro.com @ 2006-04-19 10:01 UTC (permalink / raw)
To: pgsql-admin
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) 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Problem with /usr/local/pgsql/bin/psql
@ 2006-04-24 09:20 Robin Iddon <robin@edesix.com>
parent: dhanesh.prabha@wipro.com
1 sibling, 0 replies; 5+ messages in thread
From: Robin Iddon @ 2006-04-24 09:20 UTC (permalink / raw)
To: ; +Cc: pgsql-admin
Your problem here is quoting. You need to escape the quotes around the
SQL strings so that the shell (I assume you're using Unix of some
flavour) doesn't interpret them:
/usr/local/pgsql/bin/psql -d temp -c 'insert into
temp.ip_mapping_tb(ip,location) values(\'192.100.9.51\',\'FirstFloor\')'
However, if I were you I would consider running via a file anyway - if
you save your query into a file then you can use
psql -d temp -f foo.sql
instead. Within the file you can type your query exactly like it should
be with no special escaping required.
Hope this helps,
Robin
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:
>
>
> 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
>
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Problem with /usr/local/pgsql/bin/psql
@ 2006-04-24 12:31 JSP <jason.palivino@gmail.com>
parent: dhanesh.prabha@wipro.com
1 sibling, 0 replies; 5+ messages in thread
From: JSP @ 2006-04-24 12:31 UTC (permalink / raw)
To: dhanesh.prabha@wipro.com <dhanesh.prabha@wipro.com>; +Cc: pgsql-admin
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 <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) 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."
--- Lily Tomlin
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Problem with /usr/local/pgsql/bin/psql
@ 2006-04-24 13:21 Jason Minion <jason.minion@sigler.com>
0 siblings, 0 replies; 5+ messages in thread
From: Jason Minion @ 2006-04-24 13:21 UTC (permalink / raw)
To: dhanesh.prabha@wipro.com; pgsql-admin
You're using single quotes inside single quotes, you'll need to either
escape them or switch to double-quotes for your outer string delimiter
(preferred). ie:
/usr/local/pgsql/bin/psql -d temp -c "insert into temp.ip_mapping_tb(ip,
location) values('192.100.9.51','First Floor')"
Jason Minion
jason.minion@sigler.com
________________________________
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of
dhanesh.prabha@wipro.com
Sent: Wednesday, April 19, 2006 5:01 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Problem with /usr/local/pgsql/bin/psql
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)
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Problem with /usr/local/pgsql/bin/psql
@ 2006-04-25 04:13 dhanesh.prabha@wipro.com
0 siblings, 0 replies; 5+ messages in thread
From: dhanesh.prabha@wipro.com @ 2006-04-25 04:13 UTC (permalink / raw)
To: jason.minion@sigler.com; pgsql-admin
Its working fine now.
Thanks a lot.
Dhanesh Prabha P.V | WIPRO Technologies | Bangalore
+91-80-25056768 | (+91) 9986335390 | Voice Net: 805-4736
-----Original Message-----
From: Jason Minion [mailto:jason.minion@sigler.com]
Sent: Monday, April 24, 2006 6:52 PM
To: Dhanesh Prabha (WT01 - CIO OFFICE & OPERATIONS);
pgsql-admin@postgresql.org
Subject: RE: [ADMIN] Problem with /usr/local/pgsql/bin/psql
You're using single quotes inside single quotes, you'll need to either
escape them or switch to double-quotes for your outer string delimiter
(preferred). ie:
/usr/local/pgsql/bin/psql -d temp -c "insert into temp.ip_mapping_tb(ip,
location) values('192.100.9.51','First Floor')"
Jason Minion
jason.minion@sigler.com
________________________________
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of
dhanesh.prabha@wipro.com
Sent: Wednesday, April 19, 2006 5:01 AM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Problem with /usr/local/pgsql/bin/psql
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)
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 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
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2006-04-25 04:13 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-19 10:01 Problem with /usr/local/pgsql/bin/psql dhanesh.prabha@wipro.com
2006-04-24 09:20 ` Robin Iddon <robin@edesix.com>
2006-04-24 12:31 ` JSP <jason.palivino@gmail.com>
2006-04-24 13:21 Re: Problem with /usr/local/pgsql/bin/psql Jason Minion <jason.minion@sigler.com>
2006-04-25 04:13 Re: Problem with /usr/local/pgsql/bin/psql dhanesh.prabha@wipro.com
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox