Re: Typed-tables patch broke pg_upgrade

From: Noah Misch <noah(at)leadboat(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: 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 11:46:48
Message-ID: 20110408114648.GB27915@tornado.gateway.2wire.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
tt0v1-alter-multiple.patch text/plain 715 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2011-04-08 12:21:50 k-neighbourhood search in databases
Previous Message Noah Misch 2011-04-08 11:08:13 Re: pg_upgrade bug found!