From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Jack Wilson <ljwilson@digitalav.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: " for read only" clause appended for safety when UseDeclareFetch=1 breaks some sql statements with trailing semicolons
Date: Thu, 06 Mar 2008 11:24:53 +0900
Message-ID: <47CF55F5.8090309@tpf.co.jp> (raw)
In-Reply-To: <OF0B65CC2A.83351659-ON85257403.005E4A54-85257403.005F978C@digitalav.com>
References: <OF0B65CC2A.83351659-ON85257403.005E4A54-85257403.005F978C@digitalav.com>
Hi Jack,
Jack Wilson wrote:
>
> I've found the change made in version psqlodbc 8.2.0501 and later
> (reference:
> http://archives.postgresql.org/pgsql-committers/2007-10/msg00420.php)
>
> 4. Be more careful about <for locking clause> in UseDeclareFetch mode.
> Add missing? "for read only" clause for read only queries for 8.3
> or later servers for safety.
>
> Here is a cvs link to the actual code change:
> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/psqlodbc/psqlodbc/convert.c.diff?r1=1.163&r2=1.164
>
>
> This change breaks existing code that sends a single sql statement with
> a trailing semicolon. What happens is the odbc driver sees
> UseDeclareFetch=1 and for sql statements appends " for read only" at the
> end of the statement. This is fine except for the situation where the
> statement has a trailing semicolon. In that case the statement ends up
> being (say) "select blah blah; for read only", which gives a syntax
> error like:
>
> ERROR: syntax error at or near "for"
> SQL state: 42601
>
> Setting UseDeclareFetch=0 fixes the problem, or using psqlodbc 8.2.0500
> or earlier, or using PostgreSQL 8.2.6--any one of these prevents the "
> for read only" from being appended to the end of the sql statement.
Oops my fault.
Unfortunately I'm very busy and please wait for a while.
regards,
Hiroshi Inoue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: inoue@tpf.co.jp, ljwilson@digitalav.com
Subject: Re: " for read only" clause appended for safety when UseDeclareFetch=1 breaks some sql statements with trailing semicolons
In-Reply-To: <47CF55F5.8090309@tpf.co.jp>
References: <OF0B65CC2A.83351659-ON85257403.005E4A54-85257403.005F978C@digitalav.com> <47CF55F5.8090309@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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