|
Home > Archive > PostgreSQL Bugs > May 2005 > BUG #1662: Table constrains are not properly inherited.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
BUG #1662: Table constrains are not properly inherited.
|
|
| Steven Mooij 2005-05-13, 9:24 am |
|
The following bug has been logged online:
Bug reference: 1662
Logged by: Steven Mooij
Email address: steven@mooij.org
PostgreSQL version: 7.4.7
Operating system: i386-pc-linux-gnu, compiled by GCC i386-linux-gcc (GCC)
3.3.5 (Debian 1:3.3.5-12)
Description: Table constrains are not properly inherited.
Details:
When a table is inherited from, it's table constraints are 'disabled':
CREATE TABLE super (x INTEGER, PRIMARY KEY (x));
CREATE TABLE sub (y INTEGER) INHERITS (super);
INSERT INTO sub VALUES (1, 1);
INSERT INTO sub VALUES (1, 2);
INSERT INTO super VALUES (1);
This should result in a 'duplicate key violation' for the unique constraint
on super(x), but it doesn't.
In this case
SELECT x FROM super;
results in:
x
---
1
1
1
(3 rows)
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org
| |
| Euler Taveira de Oliveira 2005-05-13, 8:24 pm |
| Hi Steven,
> Description: Table constrains are not properly inherited.
>
Have you read the section 5.5 in the manual?
http://developer.postgresql.org/doc...dl-inherit.html
"A serious limitation of the inheritance feature is that indexes
(including unique constraints) and foreign key constraints only apply
to single tables, not to their inheritance children."
Euler Taveira de Oliveira
euler[at]yahoo_com_br
____________________
____________________
____________Yahoo! Mail, cada vez melhor: agora com 1GB de espaço grátis! http://mail.yahoo.com.br
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
|
|
|
|
|