postgresql/src/backend
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
..
access Fix comments related to table AMs 2020-07-14 13:17:11 +09:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
commands Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
executor HashAgg: before spilling tuples, set unneeded columns to NULL. 2020-07-12 22:59:32 -07:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit pgindent run prior to branching v13. 2020-06-07 16:57:08 -04:00
lib Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
libpq code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
main Clean up includes of s_lock.h. 2020-06-18 19:41:05 -07:00
nodes Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes 2020-07-11 13:32:28 +09:00
optimizer Fix bitmap AND/OR scans on the inside of a nestloop partition-wise join. 2020-07-14 18:56:56 -04:00
parser Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes 2020-07-11 13:32:28 +09:00
partitioning Fix two typos in a comment 2020-05-22 17:39:16 -04:00
po Translation updates 2020-05-18 12:49:30 +02:00
port Spelling adjustments 2020-06-07 15:06:51 +02:00
postmaster code: replace 'master' with 'primary' where appropriate. 2020-07-08 12:57:23 -07:00
regex Dial back -Wimplicit-fallthrough to level 3 2020-05-13 15:31:14 -04:00
replication Revert "Track statistics for spilling of changes from ReorderBuffer". 2020-07-13 08:53:23 +05:30
rewrite Add missing invocations to object access hooks 2020-05-23 14:03:04 +09:00
snowball code: replace most remaining uses of 'master'. 2020-07-08 13:24:35 -07:00
statistics Run pgindent with new pg_bsd_indent version 2.1.1. 2020-05-16 11:54:51 -04:00
storage code: replace 'master' with 'primary' where appropriate. 2020-07-08 12:57:23 -07:00
tcop Rename field "relkind" to "objtype" for CTAS and ALTER TABLE nodes 2020-07-11 13:32:28 +09:00
tsearch Mop up some no-longer-necessary hacks around printf %.*s format. 2020-06-29 17:12:38 -04:00
utils Eliminate cache lookup errors in SQL functions for object addresses 2020-07-15 09:03:10 +09:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Add missing gettext triggers 2020-04-28 13:35:40 +02:00