sql - Is there any way to tell if a database row has constraints? -


i'm using perl dbi postgresql, , users deleting rows table, of can't deleted because of foreign key constraints, fine, want way mark rows on front end it's known rows have constraints before trying delete them. right now, user hit "delete" , either error or have row deleted.

i'm not terribly familiar postgresql, believe can use:

select *  information_schema.table_constraints  table_name = 'yourtable' 

update- looks solid answer here: postgres: sql list table foreign keys


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -