Re: Tablespace Default Behavior

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Tablespace Default Behavior
Дата
Msg-id 10223.1490846567@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Tablespace Default Behavior  (harpagornis <shenlong@runbox.com>)
Ответы Re: Tablespace Default Behavior  (harpagornis <shenlong@runbox.com>)
Список pgsql-general
harpagornis <shenlong@runbox.com> writes:
> When I create a table, like this:
>     CREATE TABLE myschema.mytable (rc_id integer NOT NULL) TABLESPACE my_space;
> and then I do:
>     select * from pg_tables where schemaname ='myschema';
> the tablespace is blank for the new table.  When I look in PgAdmin, the
> tablespace shows up as "pg_default."   What do I need to change to create
> the table in the desired tablespace?

As you mention in your followup, the database's default tablespace is
'my_space', so the table is actually in the correct tablespace.

For implementation reasons, we force tables that are placed in the
database's default tablespace to be recorded as "stored in database's
tablespace", which shows up as blank in pg_tables.  That means that if you
change the database's tablespace the table will move along with the
rest of the database.  You might consider that either a feature or a
bug depending on your use-case, but that's how it works ...

            regards, tom lane


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

Предыдущее
От: harpagornis
Дата:
Сообщение: Re: Tablespace Default Behavior
Следующее
От: harpagornis
Дата:
Сообщение: Re: Tablespace Default Behavior