Should i check the existence of foreign key with an sql request or should I just try to insert and catch if it fails?
I can check if the key i'm referencing exists or not.
My question is more of a theoretical: Catching an exception vs. querying db one more time for every insert.
For example say you have two tables, Cats and Humans. Cats has a foreign key referencing Human. Before I try to insert a Cat should I check if a human with given cat's owner column exists or should I try to insert blindly and catch if it fails.