How to create a conditional Foreign key in postgres?

Need to do a conditional foreign key in postgresql, which refers to multiple tables.
Suppose I have tables t1, t2, t3 and t4. Want to make depending on t4.name
field my_foreignKey referred to tables t1, t2 and t3.
And if that not possible to do in postgres, is there a way to implement such a structure?
Thank you for any support!
CREATE TABLE t1(
id integer prymary key
type VARCHAR(20) unique not null
);
CREATE TABLE t2(
id integer prymary key
type VARCHAR(20) 
);
CREATE TABLE t3(
id integer prymary key
name VARCHAR(20) 
);
CREATE TABLE t4(
id integer prymary key
name VARCHAR(20) not null,
my_forignkey integer
);
March 19th 20 at 09:12
1 answer
March 19th 20 at 09:14
Are you sure that "conditional foreign key" is a relational model? What normal form it corresponds to?

In practice, the stored values t1, t2, and t3 in a single table with composite key, if required. For physical separation of data tables use partitioning.
About <<conditional foreign key>> is the relational model not very sure. And the way that You suggested, I don't think is an alternative solution to this problem. Or at least I don't understand how to do this using a composite key consisting of elements t1, t2 and t3. - Frances.Schneider88 commented on March 19th 20 at 09:17

Find more questions by tags SQLPostgreSQL