Re: Inheritance

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Jan Johansson <jan(dot)johansson(dot)mr(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inheritance
Date: 2016-05-24 03:30:49
Message-ID: CAMsr+YGi=rQJ=S5288JYu15UEzsXKOVh=z5JSxKTKPUH8qzAFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24 May 2016 at 00:05, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:

>
> This feature was very much a product of the time, at the height of the
> "Object Relational" fad. The trend for postgres has been in the exact
> opposite direction, towards the SQL standard. Further complicating
> matters, inheritance has been repurposed to be the foundation for
> table partitioning, making heavy changes problematic.
>

Indeed.

I find it notable that no popular ORM has bothered adopting PostgreSQL's
inheritance features, and instead just use big left joins or repeated
SELECTs to implement parent/child relationships, with foreign keys
enforcing constraints.

I consider inheritance mostly useless without the ability to have UNIQUE
indexes that span a parent relation and all its children. You can use them
for partitioning only by sacrificing a bunch of integrity protection or
creating messy chains of FKs between individual partitions.

I'd rather like to quietly deprecate inheritance and eventually remove it
once we have real partitioning and some time has passed...

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2016-05-24 03:40:11 Re: BTREE_BUILD_STATS build is broken
Previous Message Tom Lane 2016-05-24 03:09:27 Re: BTREE_BUILD_STATS build is broken