referencing more than one table

referencing more than one table

Post by Dag » Fri, 28 Sep 2001 08:19:46



Is it possible, in postgresql, to have a row reference more than one
table.
Example, I have three tables, A, B and C which all contain a column
'name', which is the primary key in A and B, and there are no duplicate
names between A and B.  Is it possible to have some kind of foreign key
on table C that makes sure that a 'name' appears in either A or B, or do
I somehow have to write my own triggers and functions to handle this?

Dag

 
 
 

1. "ON DELETE CASCADE" references more than one table

Hi All,

I have a table

CREATE TABLE address (..., ownerId int, ...)

I alse have many other tables, such as employee, contractor, vender.... All
of these table can own an address.

What is the best way to delete an address if I delete an employee or contractor?

I can not use

FOREIGN KEY (customerId) REFERENCES customer (id)

on address, because I can only reference customer, not employee or contractor.

Any information would be appreciated. Thanks in advance.

2. Good book for oracle8 on NT

3. referencing 2 indices in one table is too slow by using odbc access

4. HTML front ending New_Era APP

5. whats the best to recursively reference one table to itself

6. UDL at runtime

7. Reference to more than one table

8. DB2 v7.2 = v7.1+FP3 ?

9. Many reference tables or one with type?

10. referencing 2 indices in one table is too slow by using odbc access

11. PDOXWIN 4.5 - many to one table references.

12. combining data into one table from multiple tables - please disregard a previous one, wrong email

13. insert data from one field in one table to another field in another table