postgresql/src
Michael Paquier f6f0db4d62 Fix pg_tablespace_location() with in-place tablespaces
Using this system function with an in-place tablespace (created when
allow_in_place_tablespaces is enabled by specifying an empty string as
location) caused a failure when using readlink(), as the tablespace is,
in this case, not a symbolic link in pg_tblspc/ but a directory.

Rather than getting a failure, the commit changes
pg_tablespace_location() so as a relative path to the data directory is
returned for in-place tablespaces, to make a difference between
tablespaces created when allow_in_place_tablespaces is enabled or not.
Getting a path rather than an empty string that would match the CREATE
TABLESPACE command in this case is more useful for tests that would like
to rely on this function.

While on it, a regression test is added for this case.  This is simple
to add in the main regression test suite thanks to regexp_replace() to
mask the part of the tablespace location dependent on its OID.

Author: Michael Paquier
Reviewed-by: Kyotaro Horiguchi, Thomas Munro
Discussion: https://postgr.es/m/YiG1RleON1WBcLnX@paquier.xyz
2022-03-17 11:25:02 +09:00
..
backend Fix pg_tablespace_location() with in-place tablespaces 2022-03-17 11:25:02 +09:00
bin Change HAVE_LIBLZ4 and HAVE_LIBZSTD tests to USE_LZ4 and USE_ZSTD. 2022-03-15 13:06:25 -04:00
common Use bitwise rotate functions in more places 2022-02-20 13:22:08 +07:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Fix publish_as_relid with multiple publications 2022-03-16 18:05:58 +01:00
interfaces Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl plpython: Restore alternative output for plpython_error test. 2022-03-08 10:34:06 -08:00
port Simplify coding around path_contains_parent_reference(). 2022-01-31 13:53:38 -05:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Fix pg_tablespace_location() with in-place tablespaces 2022-03-17 11:25:02 +09:00
timezone Update copyright for 2022 2022-01-07 19:04:57 -05:00
tools dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Run tap tests in src/interfaces/libpq. 2022-02-26 16:51:47 -08:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:27:59 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00