Re: Summary and Plan for Hot Standby

Simon Riggs <simon@2ndquadrant.com>

From: Simon Riggs <simon@2ndQuadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Tatsuo Ishii <ishii@postgresql.org>, pgsql-hackers@postgresql.org
Date: 2009-11-25T06:54:06Z
Lists: pgsql-hackers
On Thu, 2009-11-19 at 10:13 +0200, Heikki Linnakangas wrote:

> At backend start, we normally take
> RowExclusiveLock on the database in postinit.c, but you had to modify
> to acquire AccessShareLock instead in standby mode.

The consensus from earlier discussion was that allowing users to grab
RowExclusiveLock during read only transactions was not a problem, since
it allowed PREPARE. So there seems no need to prevent it in other
places.

So I suggest removing most of the changes in postinit.c, and changing
the lock restrictions in lock.c to be

+	if (RecoveryInProgress() &&
+		(locktag->locktag_type == LOCKTAG_OBJECT ||
+		 locktag->locktag_type == LOCKTAG_RELATION ) &&
+		lockmode > RowExclusiveLock)
then ERROR

lockcmds.c would also be changed to allow LOCK TABLE of up to
RowExclusiveLock.

-- 
 Simon Riggs           www.2ndQuadrant.com