What is the default value for ONDELETE and ONUPDATE for foreign keys in SQL?

I assume that the foreign key reference is set to RESTRICT by default. But is there a standard for this? Is the default value equal for any type of database? Or should these meanings be defined in all statements to be sure?

+3
source share
2 answers

For postgres, NO ACTION is the default, which for most purposes is similar to RESTRICT, as indicated here .

I would recommend being explicit, especially in DDL, whenever I doubt it (and then some). There are several reasons for this:

  • ,
  • RDBMS , , ( , )
  • , , - .
+1

, ( ). , , Oracle onupdate

0

Source: https://habr.com/ru/post/1738308/


All Articles