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

NO WAIT ...

From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: pgsql-patches(at)postgresql(dot)org
Subject: NO WAIT ...
Date: 2004-02-18 17:14:15
Message-ID: 40339D67.90208@cybertec.at (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
hi everyone ...

i have attached a patch implementing NO WAIT with the help of a GUC 
variable.
documentation should be included as well.
it works nicely for me.

test=# begin;
BEGIN
test=# show wait_for_locks;
  wait_for_locks
----------------
  row share
(1 row)

test=# lock table x in exclusive mode;
LOCK TABLE
test=# commit;
COMMIT
test=# begin;
BEGIN
test=# -- somebody else has locked the table ...
test=# lock table x in exclusive mode;
ERROR:  LockAcquire failed



[hs(at)fedora pgsql]$ difforig > nowait.patch
./doc/src/sgml/runtime.sgml
./src/backend/storage/lmgr/lock.c
./src/backend/utils/misc/guc.c
./src/backend/utils/misc/postgresql.conf.sample
./src/bin/psql/tab-complete.c
./src/include/storage/lock.h
./src/include/utils/guc.h


i hope this patch is ok.
if there are any modifications needed just drop me a line.

maybe i will have some spare time to implement "SELECT FOR UPDATE 
NOWAIT" (SQL version). maybe this extension would make sense as well 
because many people porting from oracle to pg would like that.

     cheers,

         Hans

-- 
Cybertec Geschwinde u Schoenig
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/2952/30706 or +43/664/233 90 75
www.cybertec.at, www.postgresql.at, kernel.cybertec.at


Attachment: nowait.patch
Description: text/plain (7.7 KB)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-02-18 17:27:29
Subject: Re: [SQL] 7.4 - FK constraint performance
Previous:From: Tom LaneDate: 2004-02-18 16:29:21
Subject: Re: OIDs, CTIDs, updateable cursors and friends

pgsql-patches by date

Next:From: Peter EisentrautDate: 2004-02-18 17:33:59
Subject: Re: Doing psql's lexing with flex
Previous:From: Tom LaneDate: 2004-02-18 16:32:54
Subject: Re: Doing psql's lexing with flex

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