Re: pg_tablespace_location() error message - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_tablespace_location() error message
Date
Msg-id 885.1334103735@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_tablespace_location() error message  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_tablespace_location() error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pg_tablespace_location() error message  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.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.

>> 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.

> I just applied a patch to pg_upgrade to do exactly that,

AFAICS your patch does not avoid the fact that the function will throw
error on a zero input.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch: add timing of buffer I/O requests
Next
From: Tom Lane
Date:
Subject: Re: pg_tablespace_location() error message