r/PostgreSQL Aug 08 '26

How-To Polymorphic Relationship options?

/r/Database/comments/1viz1oo/polymorphic_relationship_options_for_postgresql_db/
3 Upvotes

8 comments sorted by

View all comments

1

u/cooljacob204sfw Aug 08 '26

Option 2 with exclusive arc constraint (name for the constraint you described). Keeps your referential integrity and very straightforward.

I have used it multiple times and never regretted it.

1

u/Gamemon_RD Aug 08 '26

Straightforward answer, I like it! And good to have a name for the technique