PQexec problem

Started by François LODIERover 25 years ago3 messagesgeneral
Jump to latest
#1François LODIER
zentak@agisphere.com

Hi, when I try to do something like
PQexec(conn,"BEGIN");
I have got stranges logs like query:
�(
ERROR: parser: parse error at or near "�"

It seems that postgres doesn't recieve the good query does any one no
why ??

--
--------------------------------
Fran�ois Lodier . _
. __ .
. .. ...
zentak@agisphere.com . __ .
Ouais! Et pourquoi ?? ... .
---------------------------------

#2François LODIER
zentak@agisphere.com
In reply to: François LODIER (#1)
Re: PQexec problem

Hi all,
sory to disturb you once more but in fact my problem is not whith
PGexec but with PGsetdb.
When I try to connect to my data base, a query is done and has a strange
form. There follows my logs :

FindExec: found "/usr/lib/postgresql/bin/postgres" using argv[0]
debug info:
User = postgres
RemoteHost = 192.168.1.168
RemotePort = 3881
DatabaseName = qmail
Verbose = 2
Noversion = f
timings = f
dates = European
bufsize = 128
sortmem = 512
query echo = t
InitPostgres
query: x33(
ERROR: parser: parse error at or near "x3"
AbortCurrentTransaction

So if anybody could explain me why this stuff is doing this, it would be
great !

--
--------------------------------
Fran�ois Lodier . _
. __ .
. .. ...
zentak@agisphere.com . __ .
Ouais! Et pourquoi ?? ... .
---------------------------------

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: François LODIER (#2)
Re: Re: PQexec problem

=?iso-8859-1?Q?Fran=E7ois?= LODIER <zentak@agisphere.com> writes:

When I try to connect to my data base, a query is done and has a strange
form. There follows my logs :

FindExec: found "/usr/lib/postgresql/bin/postgres" using argv[0]
debug info:
User = postgres
RemoteHost = 192.168.1.168
RemotePort = 3881
DatabaseName = qmail
Verbose = 2
Noversion = f
timings = f
dates = European
bufsize = 128
sortmem = 512
query echo = t
InitPostgres
query: x33(
ERROR: parser: parse error at or near "x3"
AbortCurrentTransaction

So if anybody could explain me why this stuff is doing this, it would be
great !

If you look into src/interfaces/libpq/fe-connect.c, you'll see that as
soon as the frontend libpq has established a connection, it sends a few
SET commands to set things like timezone and datestyle based on
client-side environment variables. I think something must be hosed in
that logic, but I'm not sure what. Try adding a few printf's in there
or stepping through it with a debugger to see what's going wrong.

Also, if you are using psql, it sends a command or two as soon as libpq
comes back; it's possible that the broken query is coming from there.
Again though, it's hard to see what could be going wrong. (You could
try starting psql with -E switch to see what it thinks it's sending.)

Keep us posted what you find out ...

regards, tom lane