Re: Typed-tables patch broke pg_upgrade

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <bruce@momjian.us>, pgsql-hackers@postgreSQL.org
Date: 2011-04-08T11:46:48Z
Lists: pgsql-hackers

Attachments

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.