Skip site navigation (1) Skip section navigation (2)

libpq: checking for record locks

From: Jim Dossey <jfd(at)mercury(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: libpq: checking for record locks
Date: 1999-05-18 01:39:52
Message-ID: 3740C4E8.AEA10070@mercury.net (view raw or flat)
Thread:
Lists: pgsql-interfaces
I'm trying to convert an existing application to postgresql 6.5.  I'm
using 6.5 because we need the "FOR UPDATE" clause in the SELECT
statement.  This is an interactive application and files locks would not
be acceptable.

I would like to find a way to detect if PQexec() or PQsendQuery() on a
"SELECT ... FOR UPDATE" command are blocked because one or more if the
records we are trying to select are locked by other transactions.  I
don't want the users waiting on a SELECT when the records they want are
in use by another user, and we don't know when they will be freed.

Thanks for any and all help,
-- 
-----------------------------------------------------------------------   
Jim Dossey                                       mailto:jfd(at)mercury(dot)net

pgsql-interfaces by date

Next:From: Jim DosseyDate: 1999-05-18 01:54:47
Subject: libpq: trying to detect record locks
Previous:From: David GiffinDate: 1999-05-18 00:07:35
Subject: A Database interface for C (like DBI.pm?)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group