Re: BUG #15901: Tablespace showing as null in psql and pgadmin - Mailing list pgsql-bugs

From Ishan joshi
Subject Re: BUG #15901: Tablespace showing as null in psql and pgadmin
Date
Msg-id MN2PR10MB3725705042BC11174B278EE5A9F00@MN2PR10MB3725.namprd10.prod.outlook.com
Whole thread Raw
In response to Re: BUG #15901: Tablespace showing as null in psql and pgadmin  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
Thanks David, Thomas for your response.

Thanks & Regards,
ISHAN JOSHI


From: David G. Johnston <david.g.johnston@gmail.com>
Sent: Wednesday, July 10, 2019 11:09 AM
To: Ishan joshi
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15901: Tablespace showing as null in psql and pgadmin
 
On Tue, Jul 9, 2019 at 10:01 PM Ishan joshi <ishanjoshi@live.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.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #15901: Tablespace showing as null in psql and pgadmin
Next
From: Rares Salcudean
Date:
Subject: Re: PG11 - Multiple Key Range Partition