← Back to team overview

maria-discuss team mailing list archive

Re: deferrable constraints syntax?


Hi Joeri

The page you mention is from the SQL-99 book, and the syntax is not supported by MariaDB (or MySQL).


On 16/07/2013 10:49, Joeri Leemans wrote:

Hi all,

I'm trying to create a deferrable foreign key constraint, according to the knowledge base article at https://kb.askmonty.org/en/constraint_type-foreign-key-constraint/. The syntax of "deferrable initially deferred" doesn't seem to be recognised. Without it, the tables are created just fine. I'm using MariaDB 5.5.31. Example:

create table one (

id int primary key


create table two (

id int primary key,

one_ref int,

constraint fk foreign key(one_ref) references one(id) deferrable initially deferred


=> error:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'deferrable initially deferred

)' at line 4

Any idea what's wrong? Is this only supported in MariaDB 10.x?


Best regards

Joeri Leemans

Mailing list: https://launchpad.net/~maria-discuss
Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp