Re: Typed-tables patch broke pg_upgrade

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Typed-tables patch broke pg_upgrade
Date: 2011-04-08 20:32:54
Message-ID: 20110408203254.GB18152@tornado.gateway.2wire.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 08, 2011 at 03:43:39PM -0400, Robert Haas wrote:
> On Wed, Mar 30, 2011 at 9:32 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> > Incidentally, this led me to notice that you can hang a typed
> > table off a table row type. ?ALTER TABLE never propagates to such typed tables,
> > allowing them to get out of sync:
> >
> > create table t (x int, y int);
> > create table is_a of t;
> > create table is_a2 of t;
> > alter table t drop y, add z int;
> > \d is_a
> > ? ? Table "public.is_a"
> > ?Column | ?Type ? | Modifiers
> > --------+---------+-----------
> > ?x ? ? ?| integer |
> > ?y ? ? ?| integer |
> > Typed table of type: t
> >
> > Perhaps we should disallow the use of table row types in CREATE TABLE ... OF?
>
> Yes, I think we need to do that.

Having thought about it some more, that would be unfortunate. We rarely
distinguish between table row types and CREATE TYPE AS types. Actually, I'm not
aware of any place we distinguish other than in ALTER TABLE/ALTER TYPE, to
instruct you to use the other.

But depending on how hard it is to fix, that might be a good stopgap.

> >> It looks like Noah Misch might have found another problem in this area.
> >> We'll have to investigate that.
> >
> > Your bits in dumpCompositeType() are most of what's needed to fix that, I think.
>
> Most?

I think it will just fall out of the completed fix for the original reported
problem. Will keep you posted.

nm

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2011-04-08 20:32:58 Re: WIP: Allow SQL-language functions to reference parameters by parameter name
Previous Message Josh Berkus 2011-04-08 20:30:30 Re: pg_upgrade bug found!