Re: inheritence children with integer columns of differing width

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: inheritence children with integer columns of differing width
Date: 2017-06-19 14:05:06
Message-ID: 27242.1497881106@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> I wondered if anyone had considered allowing inheritence children to have
> different column types than the parent (and each other).

No, and it's not sane to consider it.

> I'm thinking of the trivial (?) case of smallint/int/bigint.

What's trivial about that? Consider

select * from parent_table where somefunc(intcol);

If somefunc takes integer, this is fine, but what are we supposed to do
if the corresponding column in the child is bigint? Throw error for any
row where the value doesn't fit in int? If so, what's the point of
letting the child column type be different?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2017-06-19 15:36:55 Re: effective_io_concurrency increasing
Previous Message Justin Pryzby 2017-06-19 13:50:11 inheritence children with integer columns of differing width