Thread: Fwd: alter table ... set tablespace

Fwd: alter table ... set tablespace

From
sergio nogueira
Date:
Hi, i didn't understand:

dmonitor=> create table whattbs (id integer);
CREATE TABLE
dmonitor=> select tablename, tablespace from pg_tables where tablename='whattbs';
 tablename | tablespace
-----------+------------
  whattbs   |
(1 row)

dmonitor=> alter table whattbs set tablespace monitor_dat1;
ALTER TABLE
dmonitor=> select tablename, tablespace from pg_tables where tablename='whattbs';
 tablename | tablespace
-----------+------------
  whattbs   |
(1 row)

In what tablespace is the table?

Att.,
Sergio Nogueira

Re: Fwd: alter table ... set tablespace

From
Tom Lane
Date:
sergio nogueira <sergiopnog@gmail.com> writes:
> dmonitor=> alter table whattbs set tablespace monitor_dat1;
> ALTER TABLE
> dmonitor=> select tablename, tablespace from pg_tables where
> tablename='whattbs';
>  tablename | tablespace
> -----------+------------
>   whattbs   |
> (1 row)

> In what tablespace is the table?

It's probably in the default tablespace for the current database.

            regards, tom lane