| From: | Chris Travers <chris(dot)travers(at)adjust(dot)com> |
|---|---|
| To: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | When using multiple inheritance, insufficient tests exist for whether a data type change is safe. |
| Date: | 2018-03-08 18:37:29 |
| Message-ID: | CAN-RpxBEjC=qQp6+sgdi88MDEsdJkmGABnx4-c55B466zSUraw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PG Bug reporting form | 2018-03-09 01:32:47 | BUG #15103: Do not use pfree() to free pg_malloc() return value in vacuum_one_database() |
| Previous Message | Tom Lane | 2018-03-08 15:41:04 | Re: BUG #15102: Performance problem when doing join, index are not used |