Whether the SQL92 should be followed, my answer will be yes. Now it is easy to fix the core to fix this problem.

PostgreSQL does NOT document any unsigned type, but supports unsigned integer types. Only integer types. What works:

smallint_unsigned, int_unsigned, bigint_unsigned

Anything else does not work under PostgreSQL, but does in MySQL and thus we should do something about it.

My suggest patch (for D6 & D7) is to check whether we have a smallint, int or bigint. If so, use the '_unsigned' as defined. Otherwise, use the CHECK($name >= 0) as for the serial type. This works for all numeric types including float, numeric and serial.

It would be really appreciated if you were to patch D6 too. For 6.7.

In case you wanted to test, create an unsigned numeric with some precision/scale before the patch. Then install the patch and see. Floats/real have the same problem in PostgreSQL.

I found the problem while working with Ubercart that uses unsigned numeric in several places.

Thank you.
Alexis Wilke

Comments

AlexisWilke’s picture

Status: Needs review » Closed (fixed)

I'm closing this entry and creating two separate entries one for D7 and one for D6 to avoid the "Failed" test entry.

The new nodes are:

http://drupal.org/node/334794 (D6)

and

http://drupal.org/node/334791 (D7)

Sorry for the trouble.
Alexis Wilke

damien tournoud’s picture

Status: Closed (fixed) » Closed (duplicate)