Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YWzBM-00052p-KF for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2015 03:25:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YWzBL-0004qT-V4 for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2015 03:25:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YWzBJ-0004qK-JP for pgsql-hackers@postgresql.org; Sun, 15 Mar 2015 03:25:37 +0000 Received: from smtp2.scorpionshops.com ([82.118.24.225] helo=kilimanjaro.scorpionshops.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YWzBC-0003jV-Dz for pgsql-hackers@postgresql.org; Sun, 15 Mar 2015 03:25:36 +0000 Received: from [192.168.1.173] (92-32-205-89.tn.glocalnet.net [92.32.205.89]) by kilimanjaro.scorpionshops.com (Postfix) with ESMTPSA id 682387BC09A; Sun, 15 Mar 2015 04:25:29 +0100 (CET) Message-ID: <5504FBA9.3020900@proxel.se> Date: Sun, 15 Mar 2015 04:25:29 +0100 From: Andreas Karlsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: Julien Tachoires , Alex Shulgin CC: Alvaro Herrera , Jaime Casanova , Robert Haas , Pg Hackers Subject: Re: patch : Allow toast tables to be moved to a different tablespace References: <4E8F1666.2060409@gmail.com> <1323956011-sup-9589@alvh.no-ip.org> <87r3wn5lhq.fsf@commandprompt.com> <54A2127D.5020907@proxel.se> <54F5CFDE.20301@gmail.com> <54FE2D6B.8000205@proxel.se> <5502C06E.5010300@gmail.com> <55044F48.1090701@proxel.se> <550468FF.9080707@gmail.com> In-Reply-To: <550468FF.9080707@gmail.com> Content-Type: multipart/mixed; boundary="------------060604090507000105080507" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------060604090507000105080507 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 03/14/2015 05:59 PM, Julien Tachoires wrote: > On 14/03/2015 16:10, Andreas Karlsson wrote: >> Noticed a bug when playing round some more with pg_dump. It does not >> seem to dump custom table space for the table and default table space >> for the toast correctly. It forgets about the toast table being in >> pg_default. > > Good catch. This is now fixed. Nice. You will also want to apply the attached patch which fixes support for the --no-tablespaces flag. -- Andreas Karlsson --------------060604090507000105080507 Content-Type: text/x-patch; name="no-tablespaces.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no-tablespaces.patch" diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index bc4a0b1..8ef2df9 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -13746,7 +13746,8 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo) destroyPQExpBuffer(result); /* Change TOAST tablespace */ - if (strcmp(tbinfo->reltablespace, tbinfo->reltoasttablespace) != 0) + if (!dopt->outputNoTablespaces && + strcmp(tbinfo->reltablespace, tbinfo->reltoasttablespace) != 0) { appendPQExpBuffer(q, "\nALTER MATERIALIZED VIEW %s ", fmtId(tbinfo->dobj.name)); @@ -14032,8 +14033,9 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo) } /* Change TOAST tablespace */ - if (strcmp(tbinfo->reltoasttablespace, tbinfo->reltablespace) != 0 && - tbinfo->relkind == RELKIND_RELATION) + if (!dopt->outputNoTablespaces && + strcmp(tbinfo->reltoasttablespace, tbinfo->reltablespace) != 0 && + tbinfo->relkind == RELKIND_RELATION) { appendPQExpBuffer(q, "\nALTER TABLE %s ", fmtId(tbinfo->dobj.name)); --------------060604090507000105080507 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --------------060604090507000105080507--