diff -rN -u old-notify/CHANGELOG new-notify/CHANGELOG
--- old-notify/CHANGELOG	2003-11-13 17:13:01.000000000 -0500
+++ new-notify/CHANGELOG	2005-11-09 21:51:33.000000000 -0500
@@ -1,3 +1,5 @@
+- Updated SQL to work with both MySQL and PostgreSQL
+
 13. November 2003
 -----------------
 - Updated to work with latest theme/table changes.
diff -rN -u old-notify/INSTALL new-notify/INSTALL
--- old-notify/INSTALL	2004-09-16 06:26:52.000000000 -0500
+++ new-notify/INSTALL	2005-11-09 21:51:03.000000000 -0500
@@ -8,15 +8,23 @@
 Requirements
 ------------
 
-This module requires the lastest version of the current Drupal CVS version and
-a working Crontab.
+This module has been tested with Drupal 4.6.x. Earlier and later versions
+may also work. 
+
+A working Crontab is also required. More information on configuration cron is
+available here:
+http://drupal.org/node/23714
 
 Installation
 ------------
 
 1. Create the SQL tables. This depends a little on your system, but the most
    common method is:
-     mysql -u username -ppassword drupal < notify.mysql
+     For MySQL:
+     mysql -u username -p password drupal < notify.sql
+
+     For PostgreSQL:    
+     psql -Uusername drupal <notify.sql 
 
 2. Create a subdirectory 'notify' in the Drupal modules/ directory.
    Copy the notify.module and the notify.inc to that directory.
diff -rN -u old-notify/notify.inc new-notify/notify.inc
--- old-notify/notify.inc	2005-11-09 20:32:17.000000000 -0500
+++ new-notify/notify.inc	2005-11-09 20:41:13.000000000 -0500
@@ -8,7 +8,20 @@
         _notify_send();
         break;
       case t('Save settings'):
-        db_query('REPLACE {notify} (uid, status, node, teasers, comment) VALUES (%d, %d, %d, %d, %d)', $user->uid, $edit['status'], $edit['node'], $edit['teasers'], $edit['comment']);
+        $result = db_query('SELECT uid FROM {notify} WHERE uid = %d', $user->uid);
+        $notify = db_fetch_object($result);
+        if ($notify->uid) {
+            db_query('UPDATE {notify} SET
+                        status = %d, node=%d, teasers=%d, comment=%d
+                        WHERE uid = %d', 
+                        $edit['status'], $edit['node'], $edit['teasers'], $edit['comment'], $user->uid );
+        }
+        else {
+            db_query('INSERT INTO {notify} (uid, status, node, teasers, comment) 
+                        VALUES (%d, %d, %d, %d, %d)', 
+                        $user->uid, $edit['status'], $edit['node'], $edit['teasers'], $edit['comment']);
+        }
+
         drupal_set_message(t('Notify settings saved'));
       default:
         $result = db_query('SELECT u.name, u.mail, n.status, n.node, n.teasers, n.comment FROM {users} u LEFT JOIN {notify} n ON u.uid = n.uid WHERE u.uid = %d AND u.status = 1 ORDER BY u.name', $user->uid);
diff -rN -u old-notify/notify.mysql new-notify/notify.mysql
--- old-notify/notify.mysql	2001-11-17 09:53:33.000000000 -0500
+++ new-notify/notify.mysql	1969-12-31 19:00:00.000000000 -0500
@@ -1,15 +0,0 @@
-#
-# Table structure for table 'notify'
-#
-
-CREATE TABLE IF NOT EXISTS notify (
-  id int(10) unsigned NOT NULL default '0',
-  status tinyint(2) NOT NULL default '0',
-  node tinyint(2) NOT NULL default '0',
-  comment tinyint(2) NOT NULL default '0',
-  PRIMARY KEY  (id)
-);
-
-ALTER TABLE notify ADD attempts tinyint(4) NOT NULL default '0';
-ALTER TABLE notify CHANGE id uid int(10) unsigned NOT NULL default '0';
-ALTER TABLE notify ADD teasers tinyint(4) NOT NULL default '0';
diff -rN -u old-notify/notify.sql new-notify/notify.sql
--- old-notify/notify.sql	1969-12-31 19:00:00.000000000 -0500
+++ new-notify/notify.sql	2005-11-09 21:54:40.000000000 -0500
@@ -0,0 +1,8 @@
+CREATE TABLE notify (
+  uid int PRIMARY KEY,
+  status int NOT NULL default '0',
+  node int NOT NULL default '0',
+  comment int NOT NULL default '0',
+  attempts int NOT NULL default '0',
+  teasers int NOT NULL default '0'
+);

