Re: BUG #6581: pg_dumpall --no-tablespaces option still sets default tablespace

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: keith(at)omniti(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6581: pg_dumpall --no-tablespaces option still sets default tablespace
Date: 2012-04-11 18:21:34
Message-ID: 28153.1334168494@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

keith(at)omniti(dot)com writes:
> Using the --no-tablespaces option for pg_dumpall correctly stops tablespace
> creation and each individual object from having its tablespace set. But if
> the original database had its default tablespace changed, this is still
> added at the beginning of the dump file:

> ALTER DATABASE dbname SET default_tablespace TO 'old_db_tablespace';

Well, what the --no-tablespaces option does is suppress actions that are
related to tablespaces. However, ALTER DATABASE SET options are just
dumped out by generic code (likewise for ALTER ROLE SET, function SET
options, yadda yadda). I guess we could insert a hack that looked for
tablespace-related options and didn't print them, but it seems like it
would be a wart not a feature.

Also, the purpose of the option is to let you reload the dump into an
installation that hasn't got the same (or any) tablespaces. ALTER SET
commands won't prevent that, they'll at worst result in some NOTICEs
during the reload.

In short, I'm not real sure this should be considered a bug.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Keith Fiske 2012-04-11 18:29:28 Re: BUG #6581: pg_dumpall --no-tablespaces option still sets default tablespace
Previous Message keith 2012-04-11 17:49:16 BUG #6581: pg_dumpall --no-tablespaces option still sets default tablespace