Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE
Date
Msg-id 29320.1093238109@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE
Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> So, if you do make the changes, will the schema definition be affected by 
> those changes, or do you expect the tablespace to be embedded in the CREATE 
> SCHEMA command?

I thought the idea was for pg_dump to emit something like
SET magic_tablespace_variable = some_ts;
CREATE TABLE foo (columns...);

rather than
CREATE TABLE foo (columns...) TABLESPACE some_ts;

the point being no more and no less than this: if "some_ts" doesn't
exist (or you have other problems like insufficient permissions) then
the SET command will fail but CREATE TABLE will still succeed, allowing
the restore to complete in some reasonable fashion.

I am quite unsure why you are pushing this while also insisting that
we need "die_on_errors" mode for pg_restore.  If you are going to die
on the first error then these alternatives are equally brittle.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE
Next
From: Philip Warner
Date:
Subject: Re: [PATCHES] ALTER SCHEMA ... SET TABLESPACE