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 02:10:10
Message-ID: 20120411021010.GN3379@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 10, 2012 at 09:19:05PM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Tue, Apr 10, 2012 at 7:57 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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.
> >>
> >> Alternatively, we could expect pg_upgrade to understand that and make
> >> the substitution itself, but if the same would be needed by most uses of
> >> the function, maybe we should just do it here.
>
> > +1 for doing it in the function. I think that will improve
> > ease-of-use and give up nothing.
>
> I'm inclined to agree. It won't help pg_upgrade, but that's because
> the query pg_upgrade is using is constrained by backwards-compatibility
> considerations: it's *necessary* to join to pg_tablespace if you want
> any location details pre-9.2. But as of 9.2 it's plausible to consider
> applying this function directly to pg_class.reltablespace, so we should
> make it behave sanely for that use-case.
>
> I think it's probably about a two-line change, will research and
> apply if so.

Agreed, thanks.

--
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 Tom Lane 2012-04-11 02:26:08 Re: Last gasp
Previous Message Fujii Masao 2012-04-11 02:09:09 Re: [streaming replication] 9.1.3 streaming replication bug ?