Commit 2cb67c4c authored by Robert Haas's avatar Robert Haas

Improve a couple of comments relating to large object snapshot management.

parent 55233c33
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.160 2010/01/05 21:53:58 rhaas Exp $ * $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.161 2010/01/07 02:41:15 rhaas Exp $
* *
* NOTES * NOTES
* See acl.h. * See acl.h.
...@@ -3515,16 +3515,11 @@ pg_language_aclmask(Oid lang_oid, Oid roleid, ...@@ -3515,16 +3515,11 @@ pg_language_aclmask(Oid lang_oid, Oid roleid,
/* /*
* Exported routine for examining a user's privileges for a largeobject * Exported routine for examining a user's privileges for a largeobject
* *
* The reason why this interface has an argument of snapshot is that * When a large object is opened for reading, it is opened relative to the
* we apply a snapshot available on lo_open(), not SnapshotNow, when * caller's snapshot, but when it is opened for writing, it is always relative
* it is opened as read-only mode. * to SnapshotNow, as documented in doc/src/sgml/lobj.sgml. This function
* If we could see the metadata and data from inconsistent viewpoint, * takes a snapshot argument so that the permissions check can be made relative
* it will give us much confusion. So, we need to provide an interface * to the same snapshot that will be used to read the underlying data.
* which takes an argument of snapshot.
*
* If the caller refers a large object with a certain snapshot except
* for SnapshotNow, its permission checks should be also applied in
* the same snapshot.
*/ */
AclMode AclMode
pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid, pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_largeobject.c,v 1.36 2010/01/02 16:57:36 momjian Exp $ * $PostgreSQL: pgsql/src/backend/catalog/pg_largeobject.c,v 1.37 2010/01/07 02:41:16 rhaas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -251,9 +251,11 @@ LargeObjectAlterOwner(Oid loid, Oid newOwnerId) ...@@ -251,9 +251,11 @@ LargeObjectAlterOwner(Oid loid, Oid newOwnerId)
* We don't use the system cache to for large object metadata, for fear of * We don't use the system cache to for large object metadata, for fear of
* using too much local memory. * using too much local memory.
* *
* Note that LargeObjectExists always scans the system catalog * This function always scans the system catalog using SnapshotNow, so it
* with SnapshotNow, so it is unavailable to use to check * should not be used when a large object is opened in read-only mode (because
* existence in read-only accesses. * large objects opened in read only mode are supposed to be viewed relative
* to the caller's snapshot, whereas in read-write mode they are relative to
* SnapshotNow).
*/ */
bool bool
LargeObjectExists(Oid loid) LargeObjectExists(Oid loid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment