postgresql/src/backend
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
..
access Fix race between DROP TABLESPACE and checkpointing. 2022-03-16 17:20:24 +13:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Fix publish_as_relid with multiple publications 2022-03-16 18:05:58 +01:00
commands Fix publish_as_relid with multiple publications 2022-03-16 18:05:58 +01:00
executor Improve comment in execReplication.c 2022-03-08 14:29:03 +09:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Silence LLVM 14 API deprecation warnings. 2022-03-16 10:30:55 +13:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
optimizer Parse/analyze function renaming 2022-03-04 14:50:22 +01:00
parser Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
partitioning Fix misuse of "const" qualifier. 2022-02-13 19:20:56 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Wake up for latches in CheckpointWriteDelay(). 2022-03-16 13:57:59 +13:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix publish_as_relid with multiple publications 2022-03-16 18:05:58 +01:00
rewrite Update copyright for 2022 2022-01-07 19:04:57 -05:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Fix race between DROP TABLESPACE and checkpointing. 2022-03-16 17:20:24 +13:00
tcop Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Fix pg_tablespace_location() with in-place tablespaces 2022-03-17 11:25:02 +09:00
.gitignore
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00