pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: Hiroki Kataoka <kataoka@interwiz.koganei.tokyo.jp>
Cc: pgsql-interfaces@postgresql.org, pgsql-odbc@postgresql.org, "Steve Wranovsky" <stevew@merge.com>
Subject: Re: 7.1 beta 3 Linux ODBC BEGIN Behaviour
Date: Sat, 10 Feb 2001 12:30:45 -0500
Message-ID: <3976.981826245@sss.pgh.pa.us> (raw)
In-Reply-To: <EKEJJICOHDIEMGPNIFIJGEAKDJAA.Inoue@tpf.co.jp>
References: <EKEJJICOHDIEMGPNIFIJGEAKDJAA.Inoue@tpf.co.jp>

"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
>> There must be "SELECT ~ FOR UPDATE" of inside of the transaction.

> You are right.
> However psqlodbc has never checked "for update".
> My recent change doesn't take "for update" into
> account either. 

It'd be nice if ODBC could distinguish SELECT FOR UPDATE from plain
SELECT, but in practice it cannot reliably do so.  Doubtless we could
extend ODBC to look for "FOR UPDATE" in the text of the query, but
that will only catch simple situations.  Consider these possibilities:

* A view or rule invoked by the query uses FOR UPDATE.  (Pre-7.1, we
didn't support FOR UPDATE in views ... but we do now.)

* A function invoked by the query does SELECT FOR UPDATE internally.

For that matter, it's quite possible for a function invoked by a SELECT
to do INSERT/UPDATE/DELETE internally.  Therefore, it's impossible for
the ODBC driver to reliably distinguish a pure SELECT from a SELECT that
causes locking or even data updates.

Given these considerations, I think it's a mistake for ODBC to treat
SELECT differently from other queries for the purpose of setting
transaction boundaries.

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <3976.981826245@sss.pgh.pa.us>
Permalink:  ../3976.981826245@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3976.981826245@sss.pgh.pa.us

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Inoue@tpf.co.jp, kataoka@interwiz.koganei.tokyo.jp, stevew@merge.com
  Subject: Re: 7.1 beta 3 Linux ODBC BEGIN Behaviour
  In-Reply-To: <3976.981826245@sss.pgh.pa.us>

* 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