When using multiple inheritance, insufficient tests exist for whethera data type change is safe. - Mailing list pgsql-bugs

From Chris Travers
Subject When using multiple inheritance, insufficient tests exist for whethera data type change is safe.
Date
Msg-id CAN-RpxBEjC=qQp6+sgdi88MDEsdJkmGABnx4-c55B466zSUraw@mail.gmail.com
Whole thread Raw
List pgsql-bugs
Minimal reproduceable example:

create table buggy (Id int);
create table buggy2 (like buggy) inherits (buggy);
create table buggy3 (like buggy);
alter table buggy2 inherit buggy3;
alter table buggy3 alter id type bigint;
insert into buggy2 (Id) values (3000000000);
select * from buggy;

Result:

ERROR:  attribute "id" of relation "buggy2" does not match parent's type


Now note that when adding an inheriting table this is checked.

bug=# alter table buggy2 inherit buggy4;

ERROR:  child table "buggy2" has different type for column "id"


However this allows types to propagate in inconsistent ways down an inheritance tree with multiple inheritance and could bring queries to a screeching halt.....


--
Best Regards,
Chris Travers
Database Administrator

Tel: +49 162 9037 210 | Skype: einhverfr | www.adjust.com 
Saarbrücker Straße 37a, 10405 Berlin

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15102: Performance problem when doing join, index are not used
Next
From: PG Bug reporting form
Date:
Subject: BUG #15103: Do not use pfree() to free pg_malloc() return value invacuum_one_database()