diff -u'rNF^function' cck_20060804/content_admin.inc cck/content_admin.inc
--- cck_20060804/content_admin.inc	2006-07-11 05:03:33.000000000 -0400
+++ cck/content_admin.inc	2006-08-07 21:23:22.000000000 -0400
@@ -163,8 +163,8 @@ function _content_admin_type_edit_submit
 
       case 'pgsql':
         db_query("CREATE TABLE {node_". strtr($form_values['type_name'], '-', '_') ."} (
-            vid integer unsigned NOT NULL default '0',
-            nid integer unsigned NOT NULL default '0',
+            vid BIGINT NOT NULL default '0' CHECK(vid > 0),
+            nid BIGINT NOT NULL default '0' CHECK(nid > 0),
             PRIMARY KEY (vid)
           )");
         break;
@@ -715,9 +715,9 @@ function content_alter_db_field($previou
 
           case 'pgsql':
             db_query("CREATE TABLE {". $new_db_info['table'] ."} (
-                vid integer unsigned NOT NULL default '0',
-                delta integer unsigned NOT NULL default '0',
-                nid integer unsigned NOT NULL default '0',
+                vid BIGINT NOT NULL default '0' CHECK(vid > 0),
+                delta BIGINT NOT NULL default '0' CHECK(delta > 0),
+                nid BIGINT NOT NULL default '0' CHECK(nid > 0),
                 PRIMARY KEY (vid,delta)
               )");
             break;
@@ -736,8 +736,8 @@ function content_alter_db_field($previou
 
           case 'pgsql':
             db_query("CREATE TABLE {". $new_db_info['table'] ."} (
-                vid integer unsigned NOT NULL default '0',
-                nid integer unsigned NOT NULL default '0',
+                vid BIGINT NOT NULL default '0' CHECK(vid > 0),
+                nid BIGINT NOT NULL default '0' CHECK(nid > 0),
                 PRIMARY KEY (vid)
               )");
             break;
@@ -854,34 +854,42 @@ function content_alter_db_field($previou
 }
 
 /**
- * Add a column to a database table.
+ * Handle postgresql column type creation.
+ * Translates int types.
+ * Supports bigint types.
  *
- * @param $table
- *   Name of the table, without {}
  * @param $column
  *   Name of the column
  * @param $type
  *   Type of column
  * @param $attributes
  *   Additional optional attributes. Recognized attributes:
- *     not null => TRUE|FALSE
- *     default  => NULL|FALSE|value (with or without '', it won't be added)
+ *     length
+ *     unsigned
+ * @param &$not_null
+ * @param &$default_val
+ * @param &$default
  */
-function content_db_add_column($table, $column, $type, $attributes = array()) {
+function content_db_construct_column_type($column, $type, &$attributes, &$not_null, &$default_val, &$default) {
+
+  $basetype = $type;
+  $type = '';
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
-      $mappings = array('int' => 'integer', 'mediumint' => 'integer', 'bigint' => 'integer',
+      $mappings = array('int' => 'integer', 'mediumint' => 'integer', 'bigint' => 'bigint',
         'tinyint' => 'smallint',
         'float' => 'float',
         'varchar' => 'varchar',
         'text' => 'text', 'mediumtext' => 'text', 'longtext' => 'text');
-      if (isset($mappings[$type])) {
-        $type = $mappings[$type];
+
+      if (isset($mappings[$basetype])) {
+        $basetype = $mappings[$basetype];
       }
       else {
         watchdog('database', t('No PostgreSQL mapping found for %type data type.', array('%type' => theme('placeholder', $type))), WATCHDOG_WARNING);
       }
-      if ($type != 'varchar') {
+
+      if ($basetype != 'varchar') {
         unset($attributes['length']);
       }
       break;
@@ -911,9 +919,41 @@ function content_db_add_column($table, $
     $type .= '('. $attributes['length'] .')';
   }
   if (array_key_exists('unsigned', $attributes) && $attributes['unsigned']) {
-    $type .= ' unsigned';
+    switch ($GLOBALS['db_type']) {
+      case 'pgsql':
+        $basetype = 'bigint CHECK('.$column.' > 0)';
+        unset($attributes['unsigned']);
+        break;
+      default:
+        $type .= ' unsigned';
+        break;
+    }
   }
 
+  $type = $basetype . $type;
+  $basetype = '';
+
+  return $type;
+}
+
+
+/**
+ * Add a column to a database table.
+ *
+ * @param $table
+ *   Name of the table, without {}
+ * @param $column
+ *   Name of the column
+ * @param $type
+ *   Type of column
+ * @param $attributes
+ *   Additional optional attributes. Recognized attributes:
+ *     not null => TRUE|FALSE
+ *     default  => NULL|FALSE|value (with or without '', it won't be added)
+ */
+function content_db_add_column($table, $column, $type, $attributes = array()) {
+  $type = content_db_construct_column_type($column, $type, $attributes, &$not_null, &$default_val, &$default);
+
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
       db_query("ALTER TABLE {". $table ."} ADD $column $type");
@@ -957,51 +997,7 @@ function content_db_add_column($table, $
  *     default  => NULL|FALSE|value (with or without '', it won't be added)
  */
 function content_db_change_column($table, $column, $column_new, $type, $attributes = array()) {
-  switch ($GLOBALS['db_type']) {
-    case 'pgsql':
-      $mappings = array('int' => 'integer', 'mediumint' => 'integer', 'bigint' => 'integer',
-        'tinyint' => 'smallint',
-        'float' => 'float',
-        'varchar' => 'varchar',
-        'text' => 'text', 'mediumtext' => 'text', 'longtext' => 'text');
-      if (isset($mappings[$type])) {
-        $type = $mappings[$type];
-      }
-      else {
-        watchdog('database', t('No PostgreSQL mapping found for %type data type.', array('%type' => theme('placeholder', $type))), WATCHDOG_WARNING);
-      }
-      if ($type != 'varchar') {
-        unset($attributes['length']);
-      }
-      break;
-
-    case 'mysql':
-    case 'mysqli':
-      break;
-  }
-
-  if (array_key_exists('not null', $attributes) and $attributes['not null']) {
-    $not_null = 'NOT NULL';
-  }
-  if (array_key_exists('default', $attributes)) {
-    if (is_null($attributes['default'])) {
-      $default_val = 'NULL';
-      $default = 'default NULL';
-    }
-    elseif ($attributes['default'] === FALSE) {
-      $default = '';
-    }
-    else {
-      $default_val = "$attributes[default]";
-      $default = "default $attributes[default]";
-    }
-  }
-  if (array_key_exists('length', $attributes)) {
-    $type .= '('. $attributes['length'] .')';
-  }
-  if (array_key_exists('unsigned', $attributes) && $attributes['unsigned']) {
-    $type .= ' unsigned';
-  }
+  $type = content_db_construct_column_type($column_new, $type, $attributes, &$not_null, &$default_val, &$default);
 
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
@@ -1023,4 +1019,3 @@ function content_db_change_column($table
       break;
   }
 }
-
diff -u'rNF^function' cck_20060804/content.install cck/content.install
--- cck_20060804/content.install	2006-07-11 05:03:33.000000000 -0400
+++ cck/content.install	2006-08-07 20:29:08.000000000 -0400
@@ -129,8 +129,8 @@ function content_update_4() {
 
       case 'pgsql':
         $ret[] = update_sql("CREATE TABLE {node_". strtr($type->type_name, '-', '_') ."} (
-            vid integer unsigned NOT NULL default '0',
-            nid integer unsigned NOT NULL default '0',
+            vid BIGINT NOT NULL default '0' CHECK(vid > 0),
+            nid BIGINT NOT NULL default '0' CHECK(nid > 0),
             PRIMARY KEY (vid)
           )");
         break;
