I'm getting mismatch reports on timestamp fields (which module is insisting on unsigned timestamp fields, I'm not sure):

Mismatch (2)
Tables for which the schema and database are different.
node
*
node_counter
o column timestamp - difference on: unsigned
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)

system
*
files
o column timestamp - difference on: unsigned
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'int', 'not null' => TRUE, 'default' => 0)

This is on a PostgreSQL database, where timestamp is a reserved word. PostgreSQL doesn't have a native unsigned integer, you just have to put a >= 0 check on it. The check for a timestamp field looks like

CHECK ("timestamp" >= 0);

other 'unsigned integer' fields produce a check like:

CHECK (fid >= 0);

The difference is the quoting of the fieldname. Evidently Schema isn't prepared to deal with the quoted fieldname, and so doesn't recognize that the constraint is actually in place.

Comments

Ben Coleman’s picture

Title: Difference on quoted fieldname in check for PostgreSQL » Schema does not understand quoted fieldnames in CHECK

I've changed the title to better reflect what's going on. Any chance this will get looked at at all?

What's happening is that it is possible to use PostgreSQL reserved words as fieldnames, but they have to be quoted to distinguish them from normal reserved word use. Also, PostgreSQL doesn't have unsigned numeric types - you use a signed type and place a >= 0 constraint on it. Combine the two and you end up with a situation like that noted, where matching fields are shown as mismatches. Schema apparently does not parse a quoted column name in a CHECK correctly, and the fact that these fields are in fact unsigned is not noted.

greggles’s picture

Title: Schema does not understand quoted fieldnames in CHECK » Schema does not understand quoted fieldnames in CHECK on PostgreSQL
Status: Active » Closed (outdated)

The 6.x branch of this module is no longer supported so I am changing the status.

If this issue is still present in the 7.x version can you please reopen it and adjust the version?