Monday, January 19, 2015

Postgresql constraint

This is an sql statement to add new foreign key on table:
 
 
ALTER TABLE my_table ADD CONSTRAINT my_fk FOREIGN KEY (my_field) 
REFERENCES my_foreign_table ON DELETE CASCADE ON UPDATE CASCADE;
 
 
Please enjoy your work!
 
 
 

No comments:

Post a Comment