Fixed a few more PostgreSQL bugs with insert_id() and an issue with setting SERIAL columns manually. May break things if installed into a database without first dropping tables.
authorDan
Sat, 12 Jul 2008 12:01:07 -0400
changeset 636 c9ea830a211f
parent 635 b3a33b661681
child 642 41cd3bb2b562
child 643 2e3886a541e4
Fixed a few more PostgreSQL bugs with insert_id() and an issue with setting SERIAL columns manually. May break things if installed into a database without first dropping tables.
includes/dbal.php
install/schemas/postgresql_stage2.sql
--- a/includes/dbal.php	Sat Jul 12 10:49:10 2008 -0400
+++ b/includes/dbal.php	Sat Jul 12 12:01:07 2008 -0400
@@ -1141,7 +1141,7 @@
         eval($cmd);
       }
     }
-    $last_was_insert = preg_match('/^INSERT INTO ([a-z0-9_]+)\(/i', $this->latest_query, $match);
+    $last_was_insert = preg_match('/^INSERT INTO ([a-z0-9_]+)/i', $this->latest_query, $match);
     if ( $last_was_insert )
     {
       // trick based on PunBB's PostgreSQL driver
--- a/install/schemas/postgresql_stage2.sql	Sat Jul 12 10:49:10 2008 -0400
+++ b/install/schemas/postgresql_stage2.sql	Sat Jul 12 12:01:07 2008 -0400
@@ -389,11 +389,11 @@
 INSERT INTO {{TABLE_PREFIX}}users_extra(user_id) VALUES
   (2);
   
-INSERT INTO {{TABLE_PREFIX}}ranks(rank_id, rank_title, rank_style) VALUES
-  (1, 'user_rank_member', ''),
-  (2, 'user_rank_mod', 'font-weight: bold; color: #00AA00;'),
-  (3, 'user_rank_admin', 'font-weight: bold; color: #AA0000;'),
-  (4, 'user_rank_guest', '');
+INSERT INTO {{TABLE_PREFIX}}ranks(rank_title, rank_style) VALUES
+  ('user_rank_member', ''),
+  ('user_rank_mod', 'font-weight: bold; color: #00AA00;'),
+  ('user_rank_admin', 'font-weight: bold; color: #AA0000;'),
+  ('user_rank_guest', '');
 
 INSERT INTO {{TABLE_PREFIX}}groups(group_id,group_name,group_type,system_group) VALUES(1, 'Everyone', 3, 1),
   (2,'Administrators',3,1),