--- user_stats.install	2007-11-13 15:22:00.000000000 +0800
+++ user_stats.install	2008-01-25 11:43:06.000000000 +0800
@@ -13,6 +13,13 @@ function user_stats_install() {
         ('Post Count', 'user_post_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, ''),
         ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN, PROFILE_HIDDEN);
       break;
+    case 'pgsql':
+      db_query("DELETE FROM {profile_fields} WHERE name IN ('user_post_count', 'user_ip_address')");
+      db_query("INSERT INTO {profile_fields} (
+        title, name, explanation, category, page, type, weight, required, register, visibility, options) VALUES 
+        ('Post Count', 'user_post_count', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, ''),
+        ('IP Address', 'user_ip_address', '', 'Statistics', '', 'textfield', 0, 0, 0, %d, '')", PROFILE_HIDDEN, PROFILE_HIDDEN);
+      break;
   }
 }
 
@@ -25,6 +32,7 @@ function user_stats_uninstall() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
     case 'mysqli':
+    case 'pgsql':
       db_query("DELETE {profile_fields}, {profile_values}
         FROM {profile_fields}, {profile_values}
         WHERE {profile_fields}.fid={profile_values}.fid
