Skip to content

Commit cae6fc2

Browse files
committed
Update README for resource owners about the resource types supported
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
1 parent 69e31d0 commit cae6fc2

File tree

1 file changed

+7
-8
lines changed
  • src/backend/utils/resowner

1 file changed

+7
-8
lines changed

src/backend/utils/resowner/README

+7-8
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,19 @@ The basic operations on a ResourceOwner are:
5454
* delete a ResourceOwner (including child owner objects); all resources
5555
must have been released beforehand
5656

57+
This API directly supports the resource types listed in the definition of
58+
ResourceOwnerData struct in src/backend/utils/resowner/resowner.c.
59+
Other objects can be associated with a ResourceOwner by recording the address
60+
of the owning ResourceOwner in such an object. There is an API for other
61+
modules to get control during ResourceOwner release, so that they can scan
62+
their own data structures to find the objects that need to be deleted.
63+
5764
Locks are handled specially because in non-error situations a lock should
5865
be held until end of transaction, even if it was originally taken by a
5966
subtransaction or portal. Therefore, the "release" operation on a child
6067
ResourceOwner transfers lock ownership to the parent instead of actually
6168
releasing the lock, if isCommit is true.
6269

63-
Currently, ResourceOwners contain direct support for recording ownership of
64-
buffer pins, lmgr locks, and catcache, relcache, plancache, tupdesc, and
65-
snapshot references. Other objects can be associated with a ResourceOwner by
66-
recording the address of the owning ResourceOwner in such an object. There is
67-
an API for other modules to get control during ResourceOwner release, so that
68-
they can scan their own data structures to find the objects that need to be
69-
deleted.
70-
7170
Whenever we are inside a transaction, the global variable
7271
CurrentResourceOwner shows which resource owner should be assigned
7372
ownership of acquired resources. Note however that CurrentResourceOwner

0 commit comments

Comments
 (0)