Currently a child table has to have all the columns the parent table has: create table foo1 (x integer, y text, z bool); create table foo2 (x integer, y text, q text); alter table foo2 inherit foo1 ; ERROR: child table is missing column "z"
In theory it seems like this could be allowed as long as the parent column is nullable, then the column is just deemed to be all null in the child. You can emulate such a situation using views rather than inheritance: create view foo4 as (select * from foo1 union all select x,y, NULL::bool as z from foo2); I would have found the ability to do this via inheritance to be convenient a couple times, as a temporary measure while doing some refactoring. Or at least I think I would found it convenient, perhaps I would have actually just shot myself in the foot with it for reasons I don't understand yet. Is this something we don't want, or something we do want provided it can be implemented in a reasonable way? I have not mapped out how easy it would be to implement. I didn't find a discussion of this possibility in the archives, but it is not the easiest thing to search for. Cheers, Jeff -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers