Casper TL
Casper TL

Reputation: 348

PostgreSQL: Check if row exists or another row has a specific value

I have the following tables: enter image description here

When a new ComputerComponents is created, the database should check and only allow the insertion IF one is true:

OR

How do i do this?

Upvotes: 1

Views: 153

Answers (1)

Politank-Z
Politank-Z

Reputation: 3729

You could write an insert trigger on the effected table.

Upvotes: 1

Related Questions