Search Postgresql Archives

Re: Tablespace Default Behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



harpagornis <shenlong@xxxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux