Re: pg_tablespace_location() error message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(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:22:15
Message-ID: 885.1334103735@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-04-11 00:30:31 Re: pg_tablespace_location() error message
Previous Message Tom Lane 2012-04-11 00:16:50 Re: Patch: add timing of buffer I/O requests