postgresql - get name of violated fk in plpgsgl exception handler -
I wrote a plpgsql function to insert some data into a table. After putting in the table, I violate one of two foreign key constraints. I can catch the exception using "WHEN foreign_key_violation THEN", but I know how the infringement of FK? Is there an area within the plpgsql exception handler with this information available? According to version 9.3 you can use CONSTRAINT_NAME to see which foreign key was violated.
is.
Details in manual:
Comments
Post a Comment