Re: Perfomance decreasing

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: Alexander Loginov <sas@mplik.ru>, pgsql-general@postgresql.org
Date: 2001-08-17T04:07:11Z
Lists: pgsql-general
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> Where do I release the lock ?

I'd say you shouldn't release it at all.  Let it be held until end of
transaction.

	rel = heap_open(relid, AccessExclusiveLock);
	...
	heap_close(rel, NoLock);  /* close rel, keep lock till end of xact */

			regards, tom lane