Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> The problem with ALTER TABLE is that it can be hugely expensive, I think.
As long as you did it before loading any data, it wouldn't be too bad.
But certainly a preceding SET would be cheaper than pushing even
zero-size files around.
I don't have any problem with adding a SET variable at this stage of the
game, if everyone agrees it's an appropriate solution.
One point here is the handling of index tablespaces. I added TABLESPACE
as part of "pg_get_indexdef" output, but we'd need a different solution
if we want to go down this path. Maybe it's not a problem given this
idea about where pg_dump is going to specify tablespace. But someone
needs to take a close look at pg_dump's logic to see if this can work.
regards, tom lane