pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Karlsson <andreas@proxel.se>
To: Julien Tachoires <julmon@gmail.com>
To: Alex Shulgin <ash@commandprompt.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Jaime Casanova <jaime@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: patch : Allow toast tables to be moved to a different tablespace
Date: Sun, 15 Mar 2015 04:25:29 +0100
Message-ID: <5504FBA9.3020900@proxel.se> (raw)
In-Reply-To: <550468FF.9080707@gmail.com>
References: <4E8F1666.2060409@gmail.com>
	<CAFEQCbGPrRpV1+bQSQ-v0i-md18rvx6jpyR=TEYt+9sPCfTMYw@mail.gmail.com>
	<CAJKUy5iMp-NE=24WSNQt5Npp0SLkPTDkqVz9C8D9y=pdK=eFoQ@mail.gmail.com>
	<CAFEQCbH756DyyAPQ1ykh3+b+kE1-EhWRww1WO_x5v38C-uLnUg@mail.gmail.com>
	<CAJKUy5itRAtv7A3y7nVKmKe8SZdTU5Q-OsPr4d3ySYqoHkzK1g@mail.gmail.com>
	<CAFEQCbGmVoeSVyeh8ZCJKpN+NKH2rgvZq1rMrKjZ+YE7RpM8zw@mail.gmail.com>
	<CAJKUy5gYJPR0ETVQQvSf2-mDfdsJU-7XSUVDFN_o4+ZaZtyATg@mail.gmail.com>
	<CAFEQCbGEjp6j6-XD4C-vDaAyRHh6aMbH__BWB3kBuT505LXQyw@mail.gmail.com>
	<CA+TgmoaJOK6yKMZw8sc5HzRD8hb0bzCV0U4JuNc3XdACmfQCYw@mail.gmail.com>
	<CAFEQCbESRGXLE4+tRAnazr8QmBJzfYPwc6GP1Daq0quyuyEpZQ@mail.gmail.com>
	<1323956011-sup-9589@alvh.no-ip.org>
	<CAFEQCbEq07OopgE5xFYv2Q3eMq45hRSJkjCBO+kvpJq9NEVhow@mail.gmail.com>
	<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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

  [text/x-patch] no-tablespaces.patch (1.0K, ../5504FBA9.3020900@proxel.se/2-no-tablespaces.patch)
  download | inline diff:
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));

view thread (56+ messages)  latest in thread

Message-ID: <5504FBA9.3020900@proxel.se>
Permalink:  ../5504FBA9.3020900@proxel.se/
Also on:    postgresql.org/message-id/5504FBA9.3020900@proxel.se

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andreas@proxel.se, julmon@gmail.com, ash@commandprompt.com, alvherre@2ndquadrant.com, jaime@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: patch : Allow toast tables to be moved to a different tablespace
  In-Reply-To: <5504FBA9.3020900@proxel.se>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox