[postgis-tickets] r17167 - Use AccessShareLock in spatial_index_read_extent

Paul Ramsey pramsey at cleverelephant.ca
Thu Jan 17 03:17:20 PST 2019


Author: pramsey
Date: 2019-01-17 15:17:19 -0800 (Thu, 17 Jan 2019)
New Revision: 17167

Modified:
   trunk/postgis/gserialized_estimate.c
Log:
Use AccessShareLock in spatial_index_read_extent
References #4261


Modified: trunk/postgis/gserialized_estimate.c
===================================================================
--- trunk/postgis/gserialized_estimate.c	2019-01-17 21:49:22 UTC (rev 17166)
+++ trunk/postgis/gserialized_estimate.c	2019-01-17 23:17:19 UTC (rev 17167)
@@ -2503,7 +2503,7 @@
 	if (!idx_oid)
 		return NULL;
 
-	idx_rel = index_open(idx_oid, AccessExclusiveLock);
+	idx_rel = index_open(idx_oid, AccessShareLock);
 	buffer = ReadBuffer(idx_rel, GIST_ROOT_BLKNO);
 	page = (Page) BufferGetPage(buffer);
 	offset = FirstOffsetNumber;
@@ -2515,7 +2515,7 @@
 		if (!iid)
 		{
 			ReleaseBuffer(buffer);
-			index_close(idx_rel, AccessExclusiveLock);
+			index_close(idx_rel, AccessShareLock);
 			return NULL;
 		}
 		ituple = (IndexTuple) PageGetItem(page, iid);
@@ -2547,7 +2547,7 @@
 	}
 
 	ReleaseBuffer(buffer);
-	index_close(idx_rel, AccessExclusiveLock);
+	index_close(idx_rel, AccessShareLock);
 
 	if (key_type == STATISTIC_SLOT_2D && bounds_2df)
 	{



More information about the postgis-tickets mailing list