From 2b1f580ee2ca373d0451d89a40fc8f0a5f55ede9 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Fri, 5 Aug 2022 09:22:56 +1200 Subject: Remove configure probes for symlink/readlink, and dead code. symlink() and readlink() are in SUSv2 and all targeted Unix systems have them. We have partial emulation on Windows. Code that raised runtime errors on systems without it has been dead for years, so we can remove that and also references to such systems in the documentation. Define HAVE_READLINK and HAVE_SYMLINK macros on Unix. Our Windows replacement functions based on junction points can't be used for relative paths or for non-directories, so the macros can be used to check for full symlink support. The places that deal with tablespaces can just use symlink functions without checking the macros. (If they did check the macros, they'd need to provide an #else branch with a runtime or compile time error, and it'd be dead code.) Reviewed-by: Tom Lane Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com --- src/backend/utils/adt/misc.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/backend/utils/adt/misc.c') diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c index 89690be2ed1..af0d924459e 100644 --- a/src/backend/utils/adt/misc.c +++ b/src/backend/utils/adt/misc.c @@ -302,8 +302,6 @@ pg_tablespace_location(PG_FUNCTION_ARGS) tablespaceOid == GLOBALTABLESPACE_OID) PG_RETURN_TEXT_P(cstring_to_text("")); -#if defined(HAVE_READLINK) || defined(WIN32) - /* * Find the location of the tablespace by reading the symbolic link that * is in pg_tblspc/. @@ -349,12 +347,6 @@ pg_tablespace_location(PG_FUNCTION_ARGS) targetpath[rllen] = '\0'; PG_RETURN_TEXT_P(cstring_to_text(targetpath)); -#else - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("tablespaces are not supported on this platform"))); - PG_RETURN_NULL(); -#endif } /* -- cgit v1.2.3