mirror of
https://github.com/postgres/postgres.git
synced 2025-12-09 02:08:45 +03:00
Remove spclocation field from pg_tablespace
Instead, add a function pg_tablespace_location(oid) used to return the same information, and do this by reading the symbolic link. Doing it this way makes it possible to relocate a tablespace when the database is down by simply changing the symbolic link.
This commit is contained in:
@@ -139,13 +139,22 @@ describeTablespaces(const char *pattern, bool verbose)
|
||||
|
||||
initPQExpBuffer(&buf);
|
||||
|
||||
printfPQExpBuffer(&buf,
|
||||
"SELECT spcname AS \"%s\",\n"
|
||||
" pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
|
||||
" spclocation AS \"%s\"",
|
||||
gettext_noop("Name"),
|
||||
gettext_noop("Owner"),
|
||||
gettext_noop("Location"));
|
||||
if (pset.sversion >= 90200)
|
||||
printfPQExpBuffer(&buf,
|
||||
"SELECT spcname AS \"%s\",\n"
|
||||
" pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
|
||||
" pg_catalog.pg_tablespace_location(oid) AS \"%s\"",
|
||||
gettext_noop("Name"),
|
||||
gettext_noop("Owner"),
|
||||
gettext_noop("Location"));
|
||||
else
|
||||
printfPQExpBuffer(&buf,
|
||||
"SELECT spcname AS \"%s\",\n"
|
||||
" pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
|
||||
" spclocation AS \"%s\"",
|
||||
gettext_noop("Name"),
|
||||
gettext_noop("Owner"),
|
||||
gettext_noop("Location"));
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user