Unintuitive behavior regarding inheritance

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Unintuitive behavior regarding inheritance
Date: 2011-07-09 12:59:49
Message-ID: CAKt_ZftE1Z-5wz-DCgWPP0cG_giSz69473na2f4Bk220jZA=cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all;

I started trying to use table partitioning to handle a rather odd case
in the software I am working on. I ran into an issue (one I can
correct in my code) that strikes me as extremely unintuitive. I
figured I would report it here as behavior I would like to see change.

The basic problem is that while nearly all table contraints are
inherited, unique constraints are not. This means that primary keys
and so forth end up having to be redefined on all child tables
explicitly as part of the table creation process. This is
sufficiently unintuitive that as a result I am having to go back and
amend contributions of people far more knowledgeable on this than I
am.

It would be really helpful in the future if unique constraints and
primary keys were inherited.

At least I can adjust code, but this is a pretty big gotcha which
could go unnoticed until you have duplicates for primary key fields in
specific child tables.

Best wishes,
Chris Travers

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2011-07-09 13:09:27 Re: Unintuitive behavior regarding inheritance
Previous Message Craig Ringer 2011-07-09 12:54:36 Re: New feature: cached foreign keys