Skip to content

Extension tag M (ASCII M) holds user-facing metadata:

  • SQL types,
  • defaults,
  • ON UPDATE,
  • comments,
  • foreign key on-update actions.

The body is:

varint ncols ‖ ncols × (str sql_type ‖ opt default_expr ‖ opt on_update ‖ opt comment)
varint nfk ‖ nfk × on_update u8
opt = 0 | 1 ‖ str

on_update uses the action codes of Ext R: 0 RESTRICT, 1 CASCADE, 2 SET NULL, 3 NO ACTION. The writer always emits this tag. ncols and nfk must equal the table’s column and foreign key counts. The storage type of each column is in Column definition.