postgresql - get name of violated fk in plpgsgl exception handler -



postgresql - get name of violated fk in plpgsgl exception handler -

i wrote plpgsql function insert info table. inserting table violate 1 of 2 foreign key constraints. can grab exception using "when foreign_key_violation then" how can find out fk violated? there field accessible within plpgsql exception handler containing information?

as of version 9.3 can utilize constraint_name see foreign key has been violated.

details in manual: http://www.postgresql.org/docs/9.3/interactive/plpgsql-control-structures.html

postgresql exception exception-handling plpgsql

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -