]> granicus.if.org Git - postgresql/commit
Arrange for the pg_foo_is_visible and has_foo_privilege families of functions
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Dec 2008 18:09:41 +0000 (18:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Dec 2008 18:09:41 +0000 (18:09 +0000)
commit66bb74dbe8206a35433d7cb0c47d82248a019802
treed38c28f8c9ba04cc78120f1eaab727e8575060b2
parent3f7e1e4b91889ac3aa6495cabb6d3a5072d9ca45
Arrange for the pg_foo_is_visible and has_foo_privilege families of functions
to return NULL, instead of erroring out, if the target object is specified by
OID and we can't find that OID in the catalogs.  Since these functions operate
internally on SnapshotNow rules, there is a race condition when using them
in user queries: the query's MVCC snapshot might "see" a catalog row that's
already committed dead, leading to a failure when the inquiry function is
applied.  Returning NULL should generally provide more convenient behavior.
This issue has been complained of before, and in particular we are now seeing
it in the regression tests due to another recent patch.
src/backend/catalog/namespace.c
src/backend/utils/adt/acl.c
src/test/regress/expected/privileges.out