Re: Typed-tables patch broke pg_upgrade - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Typed-tables patch broke pg_upgrade
Date
Msg-id 20110408114648.GB27915@tornado.gateway.2wire.net
Whole thread Raw
In response to Re: Typed-tables patch broke pg_upgrade  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Wed, Mar 30, 2011 at 09:32:08PM -0400, Noah Misch wrote:
> ... ALTER TYPE mistakenly
> only touches the first table-of-type:
>
> create type t as (x int, y int);
> create table is_a of t;
> create table is_a2 of t;
> alter type t drop attribute y cascade, add attribute z int cascade;
> \d is_a
>      Table "public.is_a"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  x      | integer |
>  z      | integer |
> Typed table of type: t
> \d is_a2
>      Table "public.is_a2"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  x      | integer |
>  y      | integer |
> Typed table of type: t
>
> Might be a simple fix; looks like find_typed_table_dependencies() only grabs the
> first match.

This is a fairly independent one-liner, so here's that patch.  I didn't
incorporate the test case, because it seems distinctly unlikely to recur.

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pg_upgrade bug found!
Next
From: Oleg Bartunov
Date:
Subject: k-neighbourhood search in databases