Re: pg_tablespace_location() error message

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_tablespace_location() error message
Date: 2012-04-11 00:47:28
Message-ID: 20120411004728.GL3379@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 10, 2012 at 08:22:15PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > On Tue, Apr 10, 2012 at 07:57:30PM -0400, Tom Lane wrote:
> >> If we expect this function to mainly be applied to pg_class.reltablespace,
> >> then it seems like it ought to understand that zero means "the database
> >> default" and substitute the database's default tablespace. That might
> >> or might not be the same as the cluster default.
>
> > Well, do we really want to be reporting the _current_ data directory
> > location? We do track tablespace symlink moves because we read the
> > symlinks now, so that isn't out of the question. A bigger question is
> > whether returning '' for a database-default location is valid --- I am
> > thinking no.
>
> Well, the point is that we should return that for the *cluster* default
> tablespace (mainly because we have nothing better available). But the
> database default might or might not be the cluster default.

Right. The complexity is that in our pre-9.2 pg_tablespace, spclocation
of '' means cluster default, and no row pg_tablespace row (0) meant
db-default. The fact that pg_tablespace_location() returns '' for
cluster default could be called an bug, or not. ;-)

I think the functions purpose is just different from what pg_tablespace
did -- the function returns the symlink location, so '' for cluster
default seems fine because there is no symlink.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2012-04-11 00:48:25 Re: psql: tab completions for 'WITH'
Previous Message Greg Smith 2012-04-11 00:43:12 Re: Last gasp