Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id AAE2FF937E3 for ; Tue, 7 Aug 2012 22:16:39 -0300 (ADT) Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Syut2-0002UG-Qv for pgsql-odbc@postgresql.org; Wed, 08 Aug 2012 01:16:38 +0000 Received: by pbbrr13 with SMTP id rr13so556881pbb.19 for ; Tue, 07 Aug 2012 18:16:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-forwarded-message-id:content-type:x-gm-message-state; bh=GT56T/wlWXDWXag8BL5Ri+HIzueruRRg1FxS9pg8V64=; b=mTBWxaq0yI9eFOHkXg4E95ulSmu8lztlgNeJZD5dtYQEoYJrIRNVRcOMI9fN4dRODn YDuA9PZOpEql9bhaRVAxec8IEIX7UYIuTPtooyfEAQnjsU3Br+U9t2W7vPQRHSDtXKiU vQczF+2OKfan8+AyfK3kXhmwu9xxeUoH/gH/HQOwd4ezfryCcct7UJsb/fSDeHYVFPpn oDxZaHNOqaHYVeusSWtAnyxt4wOciRglMYpJpT6LxWBn/6zu5snV90SJjFQxo6iQgGUl 5KPmszjLmxBKlAwDQ9SxWmT5aNFV2xX4tbMZguEHez8wqE8oyscVAIl9N9yN4n8YTL2b gZkQ== Received: by 10.68.226.38 with SMTP id rp6mr31918518pbc.90.1344388583625; Tue, 07 Aug 2012 18:16:23 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id wh7sm8788077pbc.33.2012.08.07.18.16.20 (version=SSLv3 cipher=OTHER); Tue, 07 Aug 2012 18:16:22 -0700 (PDT) Message-ID: <5021BDE2.7000402@ringerc.id.au> Date: Wed, 08 Aug 2012 09:16:18 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Fwd: [BUGS] Small bug in psqlodbc-09.01 prevents interoperability with LISTSERV References: In-Reply-To: X-Forwarded-Message-Id: Content-Type: multipart/alternative; boundary="------------000708030703050808010403" X-Gm-Message-State: ALoCoQnj0oqsD3Yr18bDtuq4mNrEOYuOTiwKRB/sqaeIKNmqSgbIHOy4RqsrIXlU/Ral0AsqMKg0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/23 X-Sequence-Number: 10932 This is a multi-part message in MIME format. --------------000708030703050808010403 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ODBC issue report from -bugs -------- Original Message -------- Subject: [BUGS] Small bug in psqlodbc-09.01 prevents interoperability with LISTSERV Date: Sat, 4 Aug 2012 15:43:58 +0000 From: Eric Thomas To: pgsql-bugs@postgresql.org Because we have customers who think Excel is an RDBMS, our product LISTSERV religiously queries ODBC capabilities at startup and prints warnings as appropriate. A customer tried to use PostgreSQL on Windows and got the following (these are our messages not yours, I am pasting them to show all the version numbers): > Driver manager version: 03.80.7601.0000 > ODBC driver: PSQLODBC35W.DLL (09.01.0100) > DBMS: PostgreSQL (9.1.4) > [FATAL] LIKE operator has no ESCAPE clause, errors will occur! > [SEVERE] FOR UPDATE clause not supported, no locking will occur Due to the popularity of underscores in e-mail addresses, we require support for LIKE ... ESCAPE and issue a fatal compatibility warning if the functionality is not present in the DBMS. A fatal warning means that we do not support the DBMS and will not accept incidents involving it. In short, the customer must choose another database, in practice MySQL, /the/ most problematic database we have ever had to support L But from what I understand, PostgreSQL does support both the LIKE ... ESCAPE clause and the SELECT ... FOR UPDATE clause. What's more, the '{escape}' sequence seems to be implemented by the ODBC driver, but the driver claims otherwise for some reason. Here is the relevant code from info.c: case SQL_LIKE_ESCAPE_CLAUSE: /* ODBC 2.0 */ /* * is there a character that escapes '%' and '_' in a LIKE * clause? not as far as I can tell */ p = "N"; break; I assume that this was true many years ago and someone forgot to change it when implementing the '{escape}' sequence J For the second issue, the code is in info30.c: case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1: len = 4; value = SQL_CA1_NEXT; /* others aren't allowed in ODBC spec */ break; Here I am puzzled as the Microsoft documentation says no such thing, at least not today, but even in an earlier version of ODBC it would have made no sense. Allowing only the SQL_CA1_NEXT flag would defeat the whole purpose of this information call -- which database would /not/ support SQL_FETCH_NEXT? J Anyway, LISTSERV is looking for the flag SQL_CA1_SELECT_FOR_UPDATE. Note that the same problem exists for other types of cursors, although LISTSERV does not use dynamic cursors and only queries the capabilities forward-only cursors. _This is not a cosmetic issue_. LISTSERV will not use any ODBC features reported as unsupported, so we cannot tell customers that "it complains at startup but in practice it works fine" -- it doesn't. E-mail addresses containing underscores or percent signs will cause unwanted side effects because LISTSERV thinks that using '{escape}' would result in a syntax error. For reference, MySQL used to have the same two problems, and showed no interest in fixing them because "You should not use ODBC." Well how exactly am I supposed to support SQL Server and DB2? Wait until Microsoft and IBM switch to the mysql_xxx() API? J But Oracle provided a solution for the LIKE escape in the ODBC driver. The driver still reports lack of support for the FOR UPDATE clause though, probably because it is only supported by some of their umpteen back-end engines so it varies from one table to another :D Eric --------------000708030703050808010403 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit ODBC issue report from -bugs


-------- Original Message --------
Subject: [BUGS] Small bug in psqlodbc-09.01 prevents interoperability with LISTSERV
Date: Sat, 4 Aug 2012 15:43:58 +0000
From: Eric Thomas <ERIC@LSOFT.COM>
To: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>


Because we have customers who think Excel is an RDBMS, our product LISTSERV religiously queries ODBC capabilities at startup and prints warnings as appropriate. A customer tried to use PostgreSQL on Windows and got the following (these are our messages not yours, I am pasting them to show all the version numbers):

 

> Driver manager version: 03.80.7601.0000

> ODBC driver: PSQLODBC35W.DLL (09.01.0100)

> DBMS: PostgreSQL (9.1.4)

> [FATAL] LIKE operator has no ESCAPE clause, errors will occur!

> [SEVERE] FOR UPDATE clause not supported, no locking will occur

 

Due to the popularity of underscores in e-mail addresses, we require support for LIKE … ESCAPE and issue a fatal compatibility warning if the functionality is not present in the DBMS. A fatal warning means that we do not support the DBMS and will not accept incidents involving it. In short, the customer must choose another database, in practice MySQL, the most problematic database we have ever had to support L

 

But from what I understand, PostgreSQL does support both the LIKE … ESCAPE clause and the SELECT … FOR UPDATE clause. What’s more, the ‘{escape}’ sequence seems to be implemented by the ODBC driver, but the driver claims otherwise for some reason. Here is the relevant code from info.c:

 

            case SQL_LIKE_ESCAPE_CLAUSE:  /* ODBC 2.0 */

 

                  /*

                  * is there a character that escapes '%' and '_' in a LIKE

                  * clause? not as far as I can tell

                  */

                  p = "N";

                  break;

 

I assume that this was true many years ago and someone forgot to change it when implementing the ‘{escape}’ sequence J For the second issue, the code is in info30.c:

 

            case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1:

                  len = 4;

                  value = SQL_CA1_NEXT; /* others aren't allowed in ODBC spec */

                  break;

 

Here I am puzzled as the Microsoft documentation says no such thing, at least not today, but even in an earlier version of ODBC it would have made no sense. Allowing only the SQL_CA1_NEXT flag would defeat the whole purpose of this information call – which database would not support SQL_FETCH_NEXT? J Anyway, LISTSERV is looking for the flag SQL_CA1_SELECT_FOR_UPDATE. Note that the same problem exists for other types of cursors, although LISTSERV does not use dynamic cursors and only queries the capabilities forward-only cursors.

 

This is not a cosmetic issue. LISTSERV will not use any ODBC features reported as unsupported, so we cannot tell customers that “it complains at startup but in practice it works fine” – it doesn’t. E-mail addresses containing underscores or percent signs will cause unwanted side effects because LISTSERV thinks that using ‘{escape}’ would result in a syntax error.

 

For reference, MySQL used to have the same two problems, and showed no interest in fixing them because “You should not use ODBC.” Well how exactly am I supposed to support SQL Server and DB2? Wait until Microsoft and IBM switch to the mysql_xxx() API? J But Oracle provided a solution for the LIKE escape in the ODBC driver. The driver still reports lack of support for the FOR UPDATE clause though, probably because it is only supported by some of their umpteen back-end engines so it varies from one table to another :D

 

  Eric




--------------000708030703050808010403--