X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 43695D1B269 for ; Thu, 8 Jul 2004 15:09:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08250-04 for ; Thu, 8 Jul 2004 18:08:54 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 3201AD1B20E for ; Thu, 8 Jul 2004 15:08:50 -0300 (ADT) Received: (qmail 20825 invoked by uid 65534); 8 Jul 2004 18:08:51 -0000 Received: from dsl-213-023-255-071.arcor-ip.net (EHLO colt.pezone.net) (213.23.255.71) by mail.gmx.net (mp003) with SMTP; 08 Jul 2004 20:08:51 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Mark Slagell , Dave Page , pgsql-odbc@postgresql.org Subject: Re: psqlodbc versioning Date: Thu, 8 Jul 2004 20:08:50 +0200 User-Agent: KMail/1.5.1 References: <40ED6FD6.4010903@iastate.edu> In-Reply-To: <40ED6FD6.4010903@iastate.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407082008.50561.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/44 X-Sequence-Number: 4177 Mark Slagell wrote: > Being unable to improve the application ourselves since we don't own > it, and assuming we're not just getting a snow job about what odbc > supports, I'd be pleased if we could promote adding lock reporting to > the psql odbc interface -- even if that means expanding the spec a > little to duplicate that part of Oracle's behavior which our vendor > apparently relies on. (Or does that imply postgres-proper issues too, > making the idea unworkable?) Could you show us some kind of specification about what this new lock reporting interface would look like (what functions, what parameters, etc.)? It is possible to look at the current set of locks, and in 7.5 there will even be a LOCK NOWAIT option that allows you to try a lock and return a failure without waiting if the lock can't be acquired. These are only table locks. To acquire row-level locks, you use SELECT FOR UPDATE before you actually write to the table, also with the new NOWAIT option. But the whole concept of locks is sort of obsolete since PostgreSQL uses multiversion concurrency control which does not require locks (loosely speaking). Moreover, long-running transactions (which would be required to hold locks for a long time) are very problematic and should be avoided at all costs. What you need is a user-space cooperative locking system. There is a bit of that in contrib/userlock, but making that work, plus making that work with the ODBC driver and in a way that you application can swallow could be a large project.