pgsql: Make pg_tablespace_location(0) return the database's default tab

Started by Tom Laneover 14 years ago2 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3769fa5fc64298143cf535c8a06921793598e458

Modified Files
--------------
src/backend/utils/adt/misc.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql: Make pg_tablespace_location(0) return the database's default tab

On Wed, Apr 11, 2012 at 01:43:28AM +0000, Tom Lane wrote:

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.

It would be nice to remove the special-case handling of 0 in pg_upgrade,
but because it has to deal with pre-9.2 cluster, it has to remain anyway.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +