--- orig/path_redirect/path_redirect.install	2007-03-16 13:40:46.000000000 -0400
+++ patched/path_redirect/path_redirect.install	2007-10-02 02:28:42.000000000 -0400
@@ -16,6 +16,16 @@
         UNIQUE KEY rid (rid)
         ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
       break;
+    case 'pgsql':
+      db_query("CREATE TABLE {path_redirect} (
+        rid SERIAL UNIQUE,
+        path varchar(255) NOT NULL PRIMARY KEY,
+        redirect varchar(255) NOT NULL,
+        query varchar(50) NOT NULL,
+        fragment varchar(50) NOT NULL,
+        type varchar(40) NOT NULL
+        );");
+      break;
   }
   drupal_set_message(t('Database tables for the Path Redirect module have been installed.'));
 }
--- orig/path_redirect/path_redirect.module	2007-05-01 21:33:42.000000000 -0400
+++ patched/path_redirect/path_redirect.module	2007-10-02 02:37:51.000000000 -0400
@@ -26,9 +26,9 @@
   // check through the redirects
   // see if this page is one of those
   $path = db_escape_string($_GET['q']);
-  $r = db_fetch_object(db_query('SELECT redirect, query, fragment, type FROM {path_redirect} WHERE path = "%s"', $path));
+  $r = db_fetch_object(db_query("SELECT redirect, query, fragment, type FROM {path_redirect} WHERE path = '%s'", $path));
   if ($r) {
-    drupal_goto($r->redirect, ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type);
+    drupal_goto(($r->redirect=='/'?'':$r->redirect), ($r->query ? $r->query: NULL), ($r->fragment ? $r->fragment : NULL), $r->type);
   }
 }
 
@@ -280,10 +280,10 @@
 
 function path_redirect_save($edit) {
   if (!$edit['rid']) {
-    $edit['rid'] = db_next_id('{path_redirect}');
+    $edit['rid'] = db_next_id('{path_redirect_rid}');
   }
   path_redirect_delete_do($edit['rid']);
-  return db_query('INSERT INTO {path_redirect} (rid, path, redirect, query, fragment, type) VALUES (%d, "%s", "%s", "%s", "%s", "%s")', $edit['rid'], $edit['path'], $edit['redirect'], $edit['query'], $edit['fragment'], $edit['type']);
+  return db_query("INSERT INTO {path_redirect} (rid, path, redirect, query, fragment, type) VALUES (%d, '%s', '%s', '%s', '%s', '%s')", $edit['rid'], $edit['path'], $edit['redirect'], $edit['query'], $edit['fragment'], $edit['type']);
 }
 
 function path_redirect_delete_do($rid) {
