postgresql/contrib/sepgsql
Michael Paquier 2a10fdc430 Eliminate cache lookup errors in SQL functions for object addresses
When using the following functions, users could see various types of
errors of the type "cache lookup failed for OID XXX" with elog(), that
can only be used for internal errors:
* pg_describe_object()
* pg_identify_object()
* pg_identify_object_as_address()

The set of APIs managing object addresses for all object types are made
smarter by gaining a new argument "missing_ok" that allows any caller to
control if an error is raised or not on an undefined object.  The SQL
functions listed above are changed to handle the case where an object is
missing.

Regression tests are added for all object types for the cases where
these are undefined.  Before this commit, these cases failed with cache
lookup errors, and now they basically return NULL (minus the name of the
object type requested).

Author: Michael Paquier
Reviewed-by: Aleksander Alekseev, Dmitry Dolgov, Daniel Gustafsson,
Álvaro Herrera, Kyotaro Horiguchi
Discussion: https://postgr.es/m/CAB7nPqSZxrSmdHK-rny7z8mi=EAFXJ5J-0RbzDw6aus=wB5azQ@mail.gmail.com
2020-07-15 09:03:10 +09:00
..
expected Fix cache reference leak in contrib/sepgsql. 2020-04-16 14:45:54 -04:00
sql Fix cache reference leak in contrib/sepgsql. 2020-04-16 14:45:54 -04:00
.gitignore Minor sepgsql regression test fixes. 2011-02-02 23:46:51 -05:00
database.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
dml.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
hooks.c Represent command completion tags as structs 2020-03-02 18:19:51 -03:00
label.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
launcher Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
proc.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
relation.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
schema.c Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
selinux.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sepgsql-regtest.te Update sepgsql to add mandatory access control for TRUNCATE 2019-11-23 10:46:44 -05:00
sepgsql.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
sepgsql.sql.in sepgsql_setcon(). 2012-03-15 16:08:40 -04:00
test_sepgsql Update sepgsql to add mandatory access control for TRUNCATE 2019-11-23 10:46:44 -05:00
uavc.c Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30