This is a copy of bug http://drupal.org/node/334598 which I specialized for D6. The D7 version is here: http://drupal.org/node/334791
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
| Comment | File | Size | Author |
|---|---|---|---|
| drupal-postgresql-unsigned-6.x.patch | 754 bytes | AlexisWilke |
Comments
Comment #1
damien tournoud commentedThis is a duplicate of #256001: pgsql driver does not handle unsigned numeric fields.