Re: Tablespace column value null on select * from pg_tables

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Tablespace column value null on select * from pg_tables
Дата
Msg-id d509ccd5-d910-4ff4-5205-a20fe43109c6@gmx.net
обсуждение исходный текст
Ответ на Tablespace column value null on select * from pg_tables  (Alex Williams <valenceshell@protonmail.com>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Alex Williams
Дата:
Сообщение: Re: Tablespace column value null on select * from pg_tables
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Tablespace column value null on select * from pg_tables