Re: Pg_upgrade and toast tables bug discovered

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pg_upgrade and toast tables bug discovered
Date: 2014-07-14 17:23:56
Message-ID: CAFcNs+rCBwns8pcsqT2fV0zBKxKZ7mGpinHCevJk5tSnyua79A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 14, 2014 at 12:26 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Fri, Jul 11, 2014 at 9:55 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > On Fri, Jul 11, 2014 at 09:48:06AM -0400, Bruce Momjian wrote:
> >> > Uh, why does this need to be in ALTER TABLE? Can't this be part of
> >> > table creation done by pg_dump?
> >>
> >> Uh, I think you need to read the thread. We have to delay the toast
> >> creation part so we don't use an oid that will later be required by
> >> another table from the old cluster. This has to be done after all
> >> tables have been created.
> >>
> >> We could have pg_dump spit out those ALTER lines at the end of the
dump,
> >> but it seems simpler to do it in pg_upgrade.
> >>
> >> Even if we have pg_dump create all the tables that require pre-assigned
> >> TOAST oids first, then the other tables that _might_ need a TOAST
table,
> >> those later tables might create a toast oid that matches a later
> >> non-TOAST-requiring table, so I don't think that fixes the problem.
> >
> > What would be nice is if I could mark just the tables that will need
> > toast tables created in that later phase (those tables that didn't have
> > a toast table in the old cluster, but need one in the new cluster).
> > However, I can't see where to store that or how to pass that back into
> > pg_upgrade. I don't see a logical place in pg_class to put it.
>
> reloptions?
>

Is this another use case to "custom reloptions" idea?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-07-14 17:53:24 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Steve Singer 2014-07-14 17:19:11 Re: 9.4 logical replication - walsender keepalive replies