From wek@kuhnle.com Fri Sep 3 09:00:56 2010 Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id AFB976329C0 for ; Fri, 3 Sep 2010 06:00:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 92405-01 for ; Fri, 3 Sep 2010 09:00:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail08a.verio.de (mail08a.verio.de [213.198.55.73]) by mail.postgresql.org (Postfix) with ESMTP id E3AA96329B6 for ; Fri, 3 Sep 2010 06:00:47 -0300 (ADT) Received: from mx49.stngva01.us.mxservers.net (204.202.242.78) by mail08a.verio.de (RS ver 1.0.95vs) with SMTP id 3-0327094443 for ; Fri, 3 Sep 2010 11:00:44 +0200 (CEST) Received: from unknown [213.198.55.139] (EHLO mmm805.verio.de) by va1-mx49.stngva01.us.mxservers.net (mxl_mta-3.1.0-05) with ESMTP id c39b08c4.733989792.916524.00-002.va1-mx49.stngva01.us.mxservers.net (envelope-from ); Fri, 03 Sep 2010 05:00:44 -0400 (EDT) Received: (qmail 95345 invoked from network); 3 Sep 2010 09:00:42 -0000 Received: from unknown (HELO 172.16.1.24) (109.193.115.141) by with SMTP; 3 Sep 2010 09:00:42 -0000 From: "Werner Kuhnle" Subject: Problem with simple SELECT over ODBC To: pgsql-odbc@postgresql.org Date: Fri, 3 Sep 2010 09:00:45 +0000 X-Priority: 3 (Normal) Importance: normal X-Mailer: David.fx by Tobit.Software, Germany (0299.4549454B4E4A50484D4D), Mime Converter 101.20 X-David-Sym: 0 X-David-Flags: 33554432 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_000_0001DB25.4C80D55D" X-Spam: [F=0.2000000000; S=0.200(2010073001); MH=0.500(2010090304)] X-MAIL-FROM: X-SOURCE-IP: [213.198.55.139] X-Loop-Detect: 1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201009/1 X-Sequence-Number: 10411 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_0001DB25.4C80D55D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I am completely new to PostgreSQL and wanted to evaluate PostgreSQL as a = substitute for MS SQL. Therefore I installed PG 9 RC and ODBC driver 8.04.02 (ANSI) The program (EXE) calling the ODBC driver (Windows 32bit written in VC++) = is using ANSI strings, not Unicode. When I try the following simple SELECT : SELECT = Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp,RowUserID,RowD= DMFields,RowID FROM Waehrungen ORDER BY Kurzzeichen =20 from within pgAdminIII then it works well. When I use exactly the same query with MS SQL and the SQL Server Native = Client 10.0 ODBC Driver it also works well. But when exactly the same SELECT is issued to PG over the PG ODBC driver = then I get : SQLRetcode=3D-1 SqlState=3D42601, NativeError=3D7, MessageText=3DERROR; syntax error at = =BB,=AB; =20 Playing around some time with ENCODING=3DWIN1252 instead of UTF-8 and = trying the UNICODE odbc driver instead of the ANSI driver gives the = following results: With the UNICODE driver the message does not occur, but the data returned = is completely corrupted. With ENCODING=3DWIN1252 the message is slightly different: SQLRetcode=3D-1 SqlState=3D42601, NativeError=3D7, MessageText=3DERROR; syntax error at = =C2=BB,=C2=AB; =20 What's wrong here ? Thanks in advance for any help/hint. Greetings Werner ------_=_NextPart_000_0001DB25.4C80D55D Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
I am completely new to PostgreSQL and wanted to = evaluate=20 PostgreSQL as a substitute for MS SQL.
Therefore I installed PG 9 RC and ODBC driver 8.04.02 = (ANSI)
The program (EXE) calling the ODBC driver (Windows 32bit = written in=20 VC++) is using ANSI strings, not Unicode.
 
When I try the following simple SELECT :
 
SELECT=20 = Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp,RowUserID,RowD= DMFields,RowID=20 FROM Waehrungen ORDER BY Kurzzeichen
 
from within pgAdminIII then it works well.
 
When I use exactly the same query with MS SQL and the SQL = Server=20 Native Client 10.0 ODBC Driver
it also works well.
 
But when exactly the same SELECT is issued to PG over the PG = ODBC=20 driver then I get :

SQLRetcode=3D-1
SqlState=3D42601, NativeError=3D7,=20 MessageText=3DERROR; syntax error at =BB,=AB;
 
Playing around some time with ENCODING=3DWIN1252 instead of = UTF-8 and=20 trying the UNICODE odbc driver instead of the ANSI driver gives the = following results:
 
With the UNICODE driver the message does not occur, but the = data=20 returned is completely corrupted.
 
With ENCODING=3DWIN1252 the message is slightly = different:
SQLRetcode=3D-1
SqlState=3D42601, NativeError=3D7, = MessageText=3DERROR;=20 syntax error at =C2=BB,=C2=AB;
 
What's wrong here ?
 
Thanks in advance for any help/hint.
 
Greetings
 
Werner
=
 

 
------_=_NextPart_000_0001DB25.4C80D55D-- From tgl@sss.pgh.pa.us Fri Sep 3 14:36:09 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C279663218A for ; Fri, 3 Sep 2010 11:36:09 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 63574-05 for ; Fri, 3 Sep 2010 14:36:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5646C6318F3 for ; Fri, 3 Sep 2010 11:36:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o83EZu8F022387; Fri, 3 Sep 2010 10:35:57 -0400 (EDT) To: "Werner Kuhnle" cc: pgsql-odbc@postgresql.org Subject: Re: Problem with simple SELECT over ODBC In-reply-to: References: Comments: In-reply-to "Werner Kuhnle" message dated "Fri, 03 Sep 2010 09:00:45 -0000" Date: Fri, 03 Sep 2010 10:35:56 -0400 Message-ID: <22386.1283524556@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/2 X-Sequence-Number: 10412 "Werner Kuhnle" writes: > But when exactly the same SELECT is issued to PG over the PG ODBC driver then I get : > SQLRetcode=-1 > SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«; > Playing around some time with ENCODING=WIN1252 instead of UTF-8 and trying the UNICODE odbc driver instead of the ANSI driver gives the following results: > With the UNICODE driver the message does not occur, but the data returned is completely corrupted. > With ENCODING=WIN1252 the message is slightly different: > SQLRetcode=-1 > SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«; > What's wrong here ? No idea, but the first thing I'd try is looking into the server's log to see what it thought the received query was. Anything that generates an error would be logged by default. regards, tom lane From inoue@tpf.co.jp Fri Sep 3 22:00:57 2010 Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7ACA363267E for ; Fri, 3 Sep 2010 19:00:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 40135-03 for ; Fri, 3 Sep 2010 22:00:49 +0000 (UTC) X-Greylist: delayed 00:06:57.140064 by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 94CAA6310AC for ; Fri, 3 Sep 2010 19:00:49 -0300 (ADT) Received: (qmail 9593 invoked by uid 512); 3 Sep 2010 21:53:47 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 3 Sep 2010 21:53:47 -0000 Received: from unknown (HELO ?192.168.24.51?) (183.76.21.68) by sd.tpf.co.jp with SMTP; 3 Sep 2010 21:53:47 -0000 Message-ID: <4C816E45.1070504@tpf.co.jp> Date: Sat, 04 Sep 2010 06:53:09 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Werner Kuhnle CC: pgsql-odbc@postgresql.org Subject: Re: Problem with simple SELECT over ODBC References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.158 tagged_above=-10 required=5 tests=BAYES_05=-0.5, DNS_FROM_RFC_BOGUSMX=1.668, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: * X-Archive-Number: 201009/5 X-Sequence-Number: 10415 (2010/09/03 18:00), Werner Kuhnle wrote: > > Hello, > I am completely new to PostgreSQL and wanted to evaluate PostgreSQL as a > substitute for MS SQL. > Therefore I installed PG 9 RC and ODBC driver 8.04.02 (ANSI) > The program (EXE) calling the ODBC driver (Windows 32bit written in > VC++) is using ANSI strings, not Unicode. > When I try the following simple SELECT : > SELECT > Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp,RowUserID,RowDDMFields,RowID > FROM Waehrungen ORDER BY Kurzzeichen > from within pgAdminIII then it works well. > When I use exactly the same query with MS SQL and the SQL Server Native > Client 10.0 ODBC Driver > it also works well. > But when exactly the same SELECT is issued to PG over the PG ODBC driver > then I get : > > SQLRetcode=-1 > SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«; Could you send me directly the Mylog output? > Playing around some time with ENCODING=WIN1252 instead of UTF-8 and > trying the UNICODE odbc driver instead of the ANSI driver gives the > following results: > With the UNICODE driver the message does not occur, but the data > returned is completely corrupted. What do you mean by "corrupted"? The Unicode driver returns the results in UTF16 strings. regards, Hiroshi Inoue