How to use curly braces in schema default value? I have a long varchar field that I'm using to save serialised data with drupal_write_record. I'd like to set the default value of the column to "a:0:{}" (which is serialize(array())).

However, when Drupal runs database updates, they are run through the update_sql() function which includes the default value in the query. This means that the '{' and '}' are interpreted as prefixing table names and removed, leaving the actual value of "a:0:" in the database, which is not what I want.

Is there a way to use curly braces in a field spec's "default" value?
In your schema, for the field you want to serialize, you can add the key serialize =&gt; TRUE and use the drupal_write_record() function to write the field in the database. After, you have just to send a simple array()(without serialize()) and Drupal will do it by himself.

You can have more information in the documentation.