Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 16EF2F7659 for ; Wed, 11 Apr 2012 15:21:51 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SI2Aw-0004bU-Ao for pgsql-bugs@postgresql.org; Wed, 11 Apr 2012 18:21:50 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q3BILYXu028154; Wed, 11 Apr 2012 14:21:34 -0400 (EDT) To: keith@omniti.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6581: pg_dumpall --no-tablespaces option still sets default tablespace In-reply-to: References: Comments: In-reply-to keith@omniti.com message dated "Wed, 11 Apr 2012 17:49:16 -0000" Date: Wed, 11 Apr 2012 14:21:34 -0400 Message-ID: <28153.1334168494@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/65 X-Sequence-Number: 32816 keith@omniti.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