Common subdirectories: /home/sgifford/src/fbconnect/facebook-client and fbconnect/facebook-client
diff -u /home/sgifford/src/fbconnect/fbconnect.install fbconnect/fbconnect.install
--- /home/sgifford/src/fbconnect/fbconnect.install	2009-02-11 16:12:56.000000000 +0000
+++ fbconnect/fbconnect.install	2009-05-28 02:35:03.000000000 +0000
@@ -22,7 +22,7 @@
          `visibility` tinyint(3) unsigned NOT NULL default '1',
           PRIMARY KEY  (`fbuid`)
           ) /*!40100 DEFAULT CHARACTER SET utf8 */");
-      db_query("CREATE TABLE `fbconnect_profile` (
+      db_query("CREATE TABLE {fbconnect_profile} (
          `uid` int(10) unsigned NOT NULL default '0',
          `name` varchar(60) NOT NULL default '',
          `religion` varchar(255) NOT NULL default '',
@@ -45,6 +45,51 @@
          `meeting_for` text,
           PRIMARY KEY  (`uid`)
         ) /*!40100 DEFAULT CHARACTER SET utf8 */");
+      break;
+    case 'pgsql':
+      if (!db_query("CREATE TABLE {fbconnect_users} (
+         uid int NOT NULL default '0',
+         fbuid int NOT NULL default '0',
+         timestamp int NOT NULL default '0',
+         import_setting text,
+         avatar smallint NOT NULL default '1',
+         visibility smallint NOT NULL default '1',
+          PRIMARY KEY  (fbuid)
+          )")
+	  || !db_query("CREATE TABLE {fbconnect_profile} (
+         uid int NOT NULL default '0',
+         name varchar(60) NOT NULL default '',
+         religion varchar(255) NOT NULL default '',
+         birthday varchar(30) NOT NULL default '',
+         sex varchar(10) NOT NULL default '',
+         relationship_status varchar(30) NOT NULL default '',
+         political varchar(50) NOT NULL default '',
+         activities text,
+         interests text,
+         music text,
+         tv text,
+         movies text,
+         books text,
+         quotes text,
+         about_me text,
+         affiliations text,
+         current_location text,
+         hometown_location text,
+         meeting_sex text,
+         meeting_for text,
+          PRIMARY KEY  (uid)
+        )")) {
+	$failure = t("Database query creating fbconnect_users failed: @db_error", array('db_error' => db_error()));
+	error_log($failure);
+	drupal_set_message($failure,'error');
+	return;
+      }
+	
+    default:
+      $failure = t("Unsupported database '@db_type'", array('db_type' => $GLOBALS['db_type']));
+      error_log($failure);
+      drupal_set_message($failure,'error');
+      return;
   }
   // Facebook user table fields
   $facebook_fields['options'] = array(
Only in fbconnect/: fbconnect.install~
diff -u /home/sgifford/src/fbconnect/fbconnect.module fbconnect/fbconnect.module
--- /home/sgifford/src/fbconnect/fbconnect.module	2009-02-11 16:12:56.000000000 +0000
+++ fbconnect/fbconnect.module	2009-05-28 02:50:52.000000000 +0000
@@ -1028,7 +1029,21 @@
  *   Facebook user id
  */
 function fbconnect_register($uid, $fbuid) {
-  return db_query("INSERT INTO {fbconnect_users} (uid, fbuid, timestamp) VALUES (%d, %d, %d) ON DUPLICATE KEY UPDATE uid = %d", $uid, $fbuid, time(), $uid);
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      return db_query("INSERT INTO {fbconnect_users} (uid, fbuid, timestamp) VALUES (%d, %d, %d)", $uid, $fbuid, time(), $uid);
+    default:
+      db_lock_table('fbconnect_users');
+      if (!db_query("UPDATE {fbconnect_users} SET uid = %d, timestamp = %d WHERE fbuid = %d", $uid, time(), $fbuid))
+	return FALSE;
+      if (db_affected_rows < 1) {
+	if (!db_query("INSERT INTO {fbconnect_users} (uid, fbuid, timestamp) VALUES (%d, %d, %d)", $uid, $fbuid, time(), $uid))
+	  return FALSE;
+      }
+      db_unlock_tables();
+      return TRUE;
+  }
 }
 
 /**
Only in fbconnect/: fbconnect.module~
Common subdirectories: /home/sgifford/src/fbconnect/images and fbconnect/images
Common subdirectories: /home/sgifford/src/fbconnect/js and fbconnect/js
Common subdirectories: /home/sgifford/src/fbconnect/translations and fbconnect/translations
