Re: WIP : change tablespace for a database - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP : change tablespace for a database
Date
Msg-id 25001.1224094995@sss.pgh.pa.us
Whole thread Raw
In response to WIP : change tablespace for a database  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: WIP : change tablespace for a database
List pgsql-hackers
Guillaume Lelarge <guillaume@lelarge.info> writes:
> To get the list of relations to move, the user needs to be connected to
> the database.

Why?  If what you are doing is changing the database's default
tablespace (which IMHO is what such a command ought to do) then
all you have to do is bulk-copy the per-DB subdirectory from
the old default tablespace to the new one.  There's no reason to
think about it at the individual-relation level, and there won't be
any change to the contents of any catalog in the DB either (only
its pg_database row will change).

> One other thing, a much worse one. It seems I can't move sys objects.

The nailed relations have to stay in the DB's default tablespace,
yes.  This is one of the reasons for my opinion above about what
the command's behavior should be.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Robert Haas"
Date:
Subject: Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Next
From: Simon Riggs
Date:
Subject: SlruPhysicalReadPage