Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Update README for resource owners about the resource types supported
authorMichael Paquier <michael@paquier.xyz>
Wed, 15 Sep 2021 01:47:44 +0000 (10:47 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 15 Sep 2021 01:47:44 +0000 (10:47 +0900)
All the types supported were listed directly in the README, but it was
very outdated.  Rather than listing all the types supported in the
README, this commit adds a reference to look at ResourceOwnerData in
resowner.c to get this information.

The order of the paragraphs is reworked a bit for clarity.

Author: Amit Langote
Discussion: https://postgr.es/m/CA+HiwqHtfT9z=4H5+F7DOy0OyNHAaVwuRcakt9b2t2uADOaiag@mail.gmail.com

src/backend/utils/resowner/README

index 2998f6bb362e11edf727969ef0cb5befa3f8580f..f94c9700df4062df246f8cbbb8ead0937d1ad9a7 100644 (file)
@@ -54,20 +54,19 @@ The basic operations on a ResourceOwner are:
 * delete a ResourceOwner (including child owner objects); all resources
   must have been released beforehand
 
+This API directly supports the resource types listed in the definition of
+ResourceOwnerData struct in src/backend/utils/resowner/resowner.c.
+Other objects can be associated with a ResourceOwner by recording the address
+of the owning ResourceOwner in such an object.  There is an API for other
+modules to get control during ResourceOwner release, so that they can scan
+their own data structures to find the objects that need to be deleted.
+
 Locks are handled specially because in non-error situations a lock should
 be held until end of transaction, even if it was originally taken by a
 subtransaction or portal.  Therefore, the "release" operation on a child
 ResourceOwner transfers lock ownership to the parent instead of actually
 releasing the lock, if isCommit is true.
 
-Currently, ResourceOwners contain direct support for recording ownership of
-buffer pins, lmgr locks, and catcache, relcache, plancache, tupdesc, and
-snapshot references.  Other objects can be associated with a ResourceOwner by
-recording the address of the owning ResourceOwner in such an object.  There is
-an API for other modules to get control during ResourceOwner release, so that
-they can scan their own data structures to find the objects that need to be
-deleted.
-
 Whenever we are inside a transaction, the global variable
 CurrentResourceOwner shows which resource owner should be assigned
 ownership of acquired resources.  Note however that CurrentResourceOwner