Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group