--- database.pgsql.inc.orig	2008-11-14 17:19:33.000000000 -0800
+++ database.pgsql.inc	2008-11-14 16:30:33.000000000 -0800
@@ -601,9 +601,10 @@
   if ($spec['type'] == 'serial') {
     unset($spec['not null']);
   }
+  $unsigned_check = null;
   if (!empty($spec['unsigned'])) {
-    if ($spec['type'] == 'serial') {
-      $sql .= " CHECK ($name >= 0)";
+    if ($spec['type'] != 'int' && $spec['type'] != 'bigint' && $spec['type'] != 'smallint') {
+      $unsigned_check = " CHECK ($name >= 0)";
     }
     else {
       $sql .= '_unsigned';
@@ -617,6 +618,8 @@
     $sql .= '('. $spec['precision'] .', '. $spec['scale'] .')';
   }
 
+  $sql .= $unsigned_check;
+
   if (isset($spec['not null']) && $spec['not null']) {
     $sql .= ' NOT NULL';
   }
