postgresql/src/backend
Tom Lane 48c5c90682 Use the "pg_temp" schema alias in EXPLAIN and related output.
This patch causes EXPLAIN output to refer to objects that are in
the current session's temp schema with the "pg_temp" schema alias
rather than that schema's actual name.  This is useful for our own
testing purposes since it will stabilize EXPLAIN VERBOSE output
for such cases, allowing us to use that in regression tests.
It should be less confusing for end users too.

Since ruleutils.c needs to change behavior for this, the change
also leaks into a few other users of ruleutils.c, for example
pg_get_viewdef().  AFAICS that won't cause any problems.
We did find that aggressively trying to change this behavior
across-the-board would cause issues, but as long as "pg_temp"
only appears within generated SQL text, I think it'll be fine.

Along the way, make get_namespace_name_or_temp conform to the
same API as get_namespace_name, ie that it returns a palloc'd
string or NULL.  The current behavior hasn't caused any bugs
since no callers attempt to pfree the result, but if it gets
more widespread usage that could become a problem.

Amul Sul, reviewed and extended by me

Discussion: https://postgr.es/m/CAAJ_b97W=QaGmag9AhWNbmx3uEYsNkXWL+OVW1_E1D3BtgWvtw@mail.gmail.com
2021-07-27 12:03:16 -04:00
..
access Make XLOG_FPI_FOR_HINT records honor full_page_writes setting. 2021-07-21 11:19:00 +09:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog More improvements of error messages about mismatching relkind 2021-07-21 07:52:10 +02:00
commands Use the "pg_temp" schema alias in EXPLAIN and related output. 2021-07-27 12:03:16 -04:00
executor Get rid of artificial restriction on hash table sizes on Windows. 2021-07-25 14:02:27 -04:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit jit: Don't inline functions that access thread-locals. 2021-07-22 15:02:18 +12:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Add more sanity checks in SASL exchanges 2021-07-10 21:45:28 +09:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Rename some node support functions for consistency 2021-07-21 10:24:06 +02:00
optimizer Fix incorrect comment for get_agg_clause_costs 2021-07-26 14:55:31 +12:00
parser Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
partitioning Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
postmaster Remove unnecessary assertion in postmaster.c 2021-07-15 15:00:45 +09:00
regex Fix performance issue in new regex match-all detection code. 2021-05-03 11:42:31 -04:00
replication Fix potential buffer overruns in proto.c. 2021-07-20 08:15:01 +05:30
rewrite Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Error message refactoring 2021-06-27 09:41:16 +02:00
storage Get rid of artificial restriction on hash table sizes on Windows. 2021-07-25 14:02:27 -04:00
tcop Use l*_node() family of functions where appropriate 2021-07-19 08:20:24 +02:00
tsearch Improve various places that double the size of a buffer 2021-07-01 15:29:06 +12:00
utils Use the "pg_temp" schema alias in EXPLAIN and related output. 2021-07-27 12:03:16 -04:00
.gitignore
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00