pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Tablespace column value null on select * from pg_tables
Date: Mon, 15 Jul 2019 22:26:49 +0200
Message-ID: <d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net> (raw)
In-Reply-To: <HF3MoPAEJHO5WGoMH1JsvhqzV3P48GQ8vOwKhad1xCLbC5-SOgGYDSmEOJFtFNARBPreyEGiuWKaI3pU2j8n7NG8kMDS41elKfD_qxB-AxY=@protonmail.com>
References: <HF3MoPAEJHO5WGoMH1JsvhqzV3P48GQ8vOwKhad1xCLbC5-SOgGYDSmEOJFtFNARBPreyEGiuWKaI3pU2j8n7NG8kMDS41elKfD_qxB-AxY=@protonmail.com>

Alex Williams schrieb am 15.07.2019 um 20:35:
> But in my case, I have a database that's in a user-defined tablespace
> (data2) and all the tables/indexes there are also in data2 and I want
> to do a select into a table the results of all the tables /
> tablespaces they are in that database...when doing this:
>> SELECT distinct tablespace FROM pg_tables;
>
> I get 2 rows: null and pg_global (I think to expect null for
> pg_default, but if the table is in a user-defined tablespace, should
> we expect it to show it, in my case, data2?)


If data2 is the default tablespace of the database, then this is expected.

The tablespace column is null in pg_tables if the table is located in the
default tablespace of the database.

See here:

https://www.postgresql.org/message-id/flat/15901-e5cfe2dd7298a3a4%40postgresql.org

And the answer on SO:

https://stackoverflow.com/a/56950950

Thomas





view thread (9+ messages)  latest in thread

Message-ID: <d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net>
Permalink:  ../d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net/
Also on:    postgresql.org/message-id/d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: Tablespace column value null on select * from pg_tables
  In-Reply-To: <d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net>
  References: <HF3MoPAEJHO5WGoMH1JsvhqzV3P48GQ8vOwKhad1xCLbC5-SOgGYDSmEOJFtFNARBPreyEGiuWKaI3pU2j8n7NG8kMDS41elKfD_qxB-AxY=@protonmail.com> <d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox