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: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Doug Wiebe <dwiebe(at)me(dot)com> wrote:

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


| [...]

| 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.


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-2017 The PostgreSQL Global Development Group