pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: pg_dump is broken for partition tablespaces
Date: Sun, 14 Apr 2019 10:38:05 -0400
Message-ID: <12678.1555252685@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f93za7CDQxBp=xW6Jr7bZt-uG_naDQ4kQree5WYiBxR7A@mail.gmail.com>
References: <CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com>
	<20190412233637.GA5173@alvherre.pgsql>
	<CAKJS1f_y6jU1HJof1_sKcVtsypO+gvrtdXvuV3afqK6RsrROrw@mail.gmail.com>
	<11955.1555251404@sss.pgh.pa.us>
	<CAKJS1f93za7CDQxBp=xW6Jr7bZt-uG_naDQ4kQree5WYiBxR7A@mail.gmail.com>

David Rowley <david.rowley@2ndquadrant.com> writes:
> On Mon, 15 Apr 2019 at 02:16, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Well, it's not really nice perhaps, but you cannot just put in some
>> other concrete tablespace OID instead.  What a zero there means is
>> "use the database's default tablespace", and the point of it is that
>> it still means that after the DB has been cloned with a different
>> default tablespace.  If we don't store 0 then we break
>> "CREATE DATABASE ... TABLESPACE = foo".

> [ quotes documents ]

I think those documentation statements are probably wrong in detail,
or at least you're misreading them if you think they are justification
for this patch.  *This change will break CREATE DATABASE*.

(And, apparently, the comment you tried to remove isn't sufficiently
clear about that.)

> Alvaro is proposing to change this behaviour for partitioned tables
> and indexes. I'm proposing not having that special case and just
> changing it.

It's possible that Alvaro's patch is also broken, but I haven't had time
to review it.  The immediate question is what happens when somebody makes
a partitioned table in template1 and then does CREATE DATABASE with a
tablespace option.  Does the partitioned table end up in the same
tablespace as ordinary tables do?

It's entirely possible BTW that this whole business of inheriting
tablespace from the partitioned table is broken and should be thrown
out.  I certainly don't see any compelling reason for partitions to
act differently from regular tables in this respect, and the more
problems we find with the idea, the less attractive it seems.

			regards, tom lane





view thread (57+ messages)  latest in thread

Message-ID: <12678.1555252685@sss.pgh.pa.us>
Permalink:  ../12678.1555252685@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12678.1555252685@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org, andres@anarazel.de
  Subject: Re: pg_dump is broken for partition tablespaces
  In-Reply-To: <12678.1555252685@sss.pgh.pa.us>

* 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