Firebird: on delete restrict doesnt exists.

Issue #1884 resolved
Former user created an issue

In Firebird, the on delete restrict, doesnt exists.

The solution is simple:

in dialects/firebird/base.py

in the line 291 when declaring class FBDDLCompiler

include the next function:

def define_constraint_cascades(self, constraint):
    text = ""
   # Firebird Not Support ON DELETE RESTRICT is working as default - 
    # http://www.firebirdfaq.org/faq338/
    if (constraint.ondelete != 'restrict') and (constraint.onupdate is not None):
        text += " ON DELETE %s" % constraint.ondelete

    if constraint.onupdate is not None:
        text += " ON UPDATE %s" % constraint.onupdate

    return text

Comments (4)

  1. Mike Bayer repo owner

    If your application requires the specific semantics of RESTRICT, as described at http://en.wikipedia.org/wiki/Foreign_key#RESTRICT , then your app is not compatible with Firebird. Instead of using an incompatible keyword and having the firebird dialect silently fall back to non-compliant behavior, the application should be adjusted to not require RESTRICT.

    So I am -1 on this change for now, will wait for other input.

  2. Log in to comment