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-10 23:27:42
Message-ID: 20120410232742.GI3379@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 10, 2012 at 07:09:33PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > On Tue, Apr 10, 2012 at 06:16:31PM -0400, Robert Haas wrote:
> >> On Tue, Apr 10, 2012 at 5:43 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> The way the function is coded, it has no need to look into pg_tablespace
> >>> as such, which is why you don't get something like "no such tablespace".
>
> >> I think what Bruce might be getting at is that 0 is more likely than a
> >> randomly chosen value to be passed to this function; for example, one
> >> can imagine wanting to pass pg_class.reltablespace.
>
> > Yes, that was my point.
>
> Hm. I have no objection to special-casing zero here, but what behavior
> do you want? Should it return an empty string as we do for
> DEFAULTTABLESPACE_OID, or throw a different error?

I have no idea. The big problem is that we currently use '' for the
cluster default, while 0 means the database default. I can't think of a
good return result --- I think it has to be an error of some kind.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-04-10 23:35:23 Re: Patch: add timing of buffer I/O requests
Previous Message Tom Lane 2012-04-10 23:17:30 Re: Patch: add timing of buffer I/O requests