Re: Sequences not moved to new tablespace

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Guillaume Drolet <droletguillaume(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sequences not moved to new tablespace
Date: 2015-02-23 19:07:47
Message-ID: 54EB7A83.9080707@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/23/2015 10:08 AM, Guillaume Drolet wrote:
> Hello,
>
> I moved all my tables and indexes from one tablespace to pg_default using
>
> ALTER TABLE ... SET TABLESPACE pg_default;
> ALTER INDEX ... SET TABLESPACE pg_default;
>
> Some 2500 files were moved to pg_default but 461 files remain in the
> tablespace and so I cannot drop it.
>
> When I query, for example:
>
> SELECT oid, relname, relkind FROM pg_catalog.pg_class
> WHERE oid IN (943602, 2650968, 2650971);
>
> I see that most of these files are sequences. Why didn't they get moved
> and how can I move them to pg_default (and all other remaining files) so
> that I can drop the tablespace?

Sequences are just a form of a table:

http://www.postgresql.org/docs/9.4/interactive/sql-altersequence.html
"
For historical reasons, ALTER TABLE can be used with sequences too; but
the only variants of ALTER TABLE that are allowed with sequences are
equivalent to the forms shown above."

So I would try the ALTER TABLE .. SET TABLESPACE on them also.

>
> Thanks!
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-23 19:14:20 Re: Sequences not moved to new tablespace
Previous Message Guillaume Drolet 2015-02-23 18:08:57 Sequences not moved to new tablespace