Re: BUG #15901: Tablespace showing as null in psql and pgadmin

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ishan joshi <ishanjoshi(at)live(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15901: Tablespace showing as null in psql and pgadmin
Date: 2019-07-10 05:39:17
Message-ID: CAKFQuwZDv76EeY_WxPo3bYQDCe0Q0jGRkH_6FiF3nZCpHx9OhA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jul 9, 2019 at 10:01 PM Ishan joshi <ishanjoshi(at)live(dot)com> wrote:

> Thanks for clarification but this should be part of functionality. It
> should show the non default tablespace if any. This is like tightly coupled
> as postgres do not want to user to use other than default tablespace.
>

PostgreSQL doesn't care one way or the other, and maybe it could have been
done differently, but at this point it isn't worth changing.

In my application, tablespace is requires to collect information for
> table. I have tried the other ways to extract it but I am failed to extract
> it.
>

As demonstrated elsewhere there is a relatively simple solution to the
problem available (which you've only really vaguely defined as
"information"). Yes, catalog queries can be difficult to put together but
for the most part learning curve trumps spending significant developer time
improving secondary functionality that can be made to work.

> can you please help , How we can extract the details of User defined
> tablespace for the table created under it.
>

The system information function: pg_tablespace_location(*tablespace_oid*)
provides the only piece of information not present on pg_tablespace -
location.

Though if you need to know the location of the pg_default tablespace you
will need to "show data_directory" (or the functional equivalent) since the
two are the same by definition and "don't repeat yourself" is again in play
(though this seems more likely amenable to change since its a user-oriented
function and not a fundamental property of the system catalogs).

For the hierarchy (default) stuff as Thomas points out the StackOverflow
posts covers the catalog query needed to query this model.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ishan joshi 2019-07-10 06:02:43 Re: BUG #15901: Tablespace showing as null in psql and pgadmin
Previous Message Thomas Kellerer 2019-07-10 05:25:03 Re: BUG #15901: Tablespace showing as null in psql and pgadmin