Re: inconsistency between postgres and PEAR?

Moritz Bunkus <[email protected]> Fri, 26 Dec 2003 20:08:55 +0100
Newsgroups gmane.comp.bug-tracking.anthill.devel
Message-ID <[email protected]>
Heya,

this time with a patch for pgsql.dump as this seemed easier to me than
modifying PEAR, something I don't know nothing about.

Seemed to work for me on a clean database (meaning the script ran
cleanly and I could add products, components, versions and bugs without
any problems).

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds

_______________________________________________
Anthill-workers mailing list
Anthill-workers-+mQDA36h6dWw5LPnMra/[email protected]
http://vmlinuz.ca/mailman/listinfo/anthill-workers
pgsql-manual-sequences.diff (text/plain, 2.5 KB)
Index: pgsql.dump
===================================================================
RCS file: /cvsroot/anthill-0.3/etc/pgsql.dump,v
retrieving revision 1.4
diff -u -r1.4 pgsql.dump
--- pgsql.dump	27 Nov 2003 00:40:31 -0000	1.4
+++ pgsql.dump	26 Dec 2003 19:06:27 -0000
@@ -49,7 +49,7 @@
 --
 
 CREATE TABLE users (
-  uid serial NOT NULL,
+  uid int8 DEFAULT NEXTVAL('users_seq') NOT NULL,
   name varchar(60) DEFAULT '' NOT NULL,
   uname varchar(25) DEFAULT '' NOT NULL,
   email varchar(60) DEFAULT '' NOT NULL,
@@ -65,6 +65,7 @@
 );
 
 CREATE INDEX idx_uid_users ON users(uid);
+CREATE SEQUENCE users_seq;
 
 --
 -- Populate table 'users'
@@ -77,7 +78,7 @@
 --
 
 CREATE TABLE bugs (
-  bid serial NOT NULL,
+  bid int8 DEFAULT NEXTVAL('bugs_seq') NOT NULL,
   assigned int8,
   severity int2,
   status int2,
@@ -98,13 +99,14 @@
 );
 
 CREATE INDEX idx_bid_bugs ON bugs(bid);
+CREATE SEQUENCE bugs_seq;
 
 --
 -- Table structure for table 'bugdesc'
 --
 
 CREATE TABLE bugdesc (
-  did serial NOT NULL,
+  did int8 DEFAULT NEXTVAL('bugdesc_seq') NOT NULL,
   bid int8,
   b_user int8,
   b_date varchar(14),
@@ -114,37 +116,42 @@
 );
 
 CREATE INDEX idx_bid_bugdesc ON bugdesc(bid);
+CREATE SEQUENCE bugdesc_seq;
 
 --
 -- Table structure for table 'products'
 --
 
 CREATE TABLE products (
-  pid serial NOT NULL,
+  pid int8 DEFAULT NEXTVAL('products_seq') NOT NULL,
   name varchar(64),
   deleted int2 DEFAULT '0',
   description text,
   PRIMARY KEY (pid)
 );
 
+CREATE SEQUENCE products_seq;
+
 --
 -- Table structure for table 'versions'
 --
 
 CREATE TABLE versions (
-  vid serial NOT NULL,
+  vid int8 DEFAULT NEXTVAL('versions_seq') NOT NULL,
   name varchar(64),
   product int8,
   deleted int2 DEFAULT '0',
   PRIMARY KEY (vid)
 );
 
+CREATE SEQUENCE versions_seq;
+
 --
 -- Table structure for table 'components'
 --
 
 CREATE TABLE components (
-  cid serial NOT NULL,
+  cid int8 DEFAULT NEXTVAL('components_seq') NOT NULL,
   name varchar(64),
   product int8,
   owner int8,
@@ -155,6 +162,7 @@
 );
 
 CREATE INDEX idx_cid_components ON components(cid);
+CREATE SEQUENCE components_seq;
 
 --
 -- Table structure for table 'status_d'
@@ -249,7 +257,7 @@
 --
 
 CREATE TABLE bugactivity (
-  aid serial NOT NULL,
+  aid int8 DEFAULT NEXTVAL('bugactivity_seq') NOT NULL,
   bid int8,
   b_user int8,
   b_date varchar(14),
@@ -261,6 +269,7 @@
 );
 
 CREATE INDEX idx_bid_bugactivity ON bugactivity(bid);
+CREATE SEQUENCE bugactivity_seq;
 
 --
 -- Table structure for table 'attachidx'
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/7IdHTJ9OsraNuaERAnO5AJ9bVmyj8bNOMdd7cKZ94oGQujLahACgnclu
W12h7d0LgdXFCOIHpOEyjCE=
=ejZ+
-----END PGP SIGNATURE-----