No reference to inherited columns? 
Author Message
 No reference to inherited columns?
Can it be that I cannot reference to any inherited columns? Or is there
a special way to do it? The manual doesn't seem to cover this one...

Thx Chris

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Sun, 26 Oct 2003 22:04:37 GMT
 No reference to inherited columns?

Quote:

> Can it be that I cannot reference to any inherited columns? Or is there
> a special way to do it? The manual doesn't seem to cover this one...

Well, if you mean reference a subtable's copy of an inherited column,
you should be able to do this as long as you create a unique index
on the subtable's copy of the inherited column (create unique index
subtable_column on subtable(column)) before you try to define the
constraint.
Example:
create table base (id int);
create table child (subvalue int) inherits (base);
create unique index child_id on child(id);
create table fk (childid int references child(id));

If you want to reference an entire tree (ie, reference a parent's
copy of a column and have it also reference children) you're
currently not able to do that.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Mon, 27 Oct 2003 00:51:26 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. references constraint on inherited tables?

2. Inherited tables vs non-inherited tables

3. Re : overriding default value in inherited column (+

4. overriding default value in inherited column

5. Changing the default value of an inherited column

6. Changing the default value of an inherited column

7. Re : overriding default value in inherited column (+ set_value function)

8. Can a column CHECK references another column ?

9. 2 Foreign Key reference at the same column

10. Referencing column names with spaces in them

11. Creating Referencing Column Doesn't Create Index?

12. Referencing a column name with whitespace?


 
Powered by phpBB® Forum Software