Search Postgresql Archives

Foreign Key with an "OR" condition (and two concatenated columns)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi. Hope I'm articulating the question correctly.

I currently have a foreign key like this:

    "fk_table2" FOREIGN KEY (id) REFERENCES table1(id) ON DELETE CASCADE;

Given the peculiar needs of this db, it seems that in some cases we
will need to track the "id" of table2 against a concatenation of two
columns in table2. So in pseudocode, it would look something like
this.

    "fk_table2" FOREIGN KEY (id) REFERENCES table1(id   OR
id||'.'||column2) ON DELETE CASCADE;

Do I need a separate constraint for this?

Many thanks for any pointers!

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux