Re: Foreign key constraint violation when using table inheritance

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Foreign key constraint violation when using table inheritance
Date: 2011-11-04 01:45:51
Message-ID: m38vnw1wz4.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Doug Wiebe <dwiebe(at)me(dot)com> wrote:

> [...]
> What am I doing wrong?

<URI:http://www.postgresql.org/docs/current/static/ddl-inherit.html>:

| [...]

| 5.8.1. Caveats

| [...]

| A serious limitation of the inheritance feature is that
| indexes (including unique constraints) and foreign key con-
| straints only apply to single tables, not to their inheri-
| tance children. This is true on both the referencing and
| referenced sides of a foreign key constraint. Thus, in the
| terms of the above example:

| [...]

| * Specifying that another table's column REFERENCES
| cities(name) would allow the other table to contain city
| names, but not capital names. There is no good workaround
| for this case.

| These deficiencies will probably be fixed in some future re-
| lease, but in the meantime considerable care is needed in
| deciding whether inheritance is useful for your application.

Tim

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tim Landscheidt 2011-11-04 02:02:05 Re: Query on DATETIME for a date (the whole day)
Previous Message Bob McConnell 2011-11-03 22:05:51 Re: DBI, savepoints, transactions, and AutoCommit -- NOT A BUG