Set table oid before writing the table to the metadata table