mirror of
https://github.com/postgres/postgres.git
synced 2025-08-06 18:42:54 +03:00
Make pg_tablespace_location(0) return the database's default tablespace.
This definition is convenient when applying the function to the reltablespace column of pg_class, since that's what zero means there; and it doesn't interfere with any other plausible use of the function. Per gripe from Bruce Momjian.
This commit is contained in:
@@ -335,7 +335,15 @@ pg_tablespace_location(PG_FUNCTION_ARGS)
|
|||||||
int rllen;
|
int rllen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return empty string for our default tablespaces
|
* It's useful to apply this function to pg_class.reltablespace, wherein
|
||||||
|
* zero means "the database's default tablespace". So, rather than
|
||||||
|
* throwing an error for zero, we choose to assume that's what is meant.
|
||||||
|
*/
|
||||||
|
if (tablespaceOid == InvalidOid)
|
||||||
|
tablespaceOid = MyDatabaseTableSpace;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return empty string for the cluster's default tablespaces
|
||||||
*/
|
*/
|
||||||
if (tablespaceOid == DEFAULTTABLESPACE_OID ||
|
if (tablespaceOid == DEFAULTTABLESPACE_OID ||
|
||||||
tablespaceOid == GLOBALTABLESPACE_OID)
|
tablespaceOid == GLOBALTABLESPACE_OID)
|
||||||
|
Reference in New Issue
Block a user