I am trying to install drupal-cvs version (21st August) on to a postgres database. There appeared to be a number of errors in the database.pgsql file, so I have done a line by line comparison against the mqsql equivalent and hopefully made it the same, whilst correcting all the errors.
Not sure if its important, but I did re-order the table creation to be in the same order as the mysql version. It seems to me that doing so will help maintainability for the future - apologies to anyone if there was a reason that order was different.
I must stress, I haven't got drupal working yet, just managed to create the database without errors, so although the changes I made seemed sensible, they may well not be - as I don't have any knowledge of the internal working of drupal;
I've created a patch file. I hope it works within a code block
--- database.pgsql 2004-08-21 00:53:59.000000000 +0100
+++ /home/alan/roo/drupal/database/database.pgsql 2004-08-21 23:52:45.000000000 +0100
@@ -29,69 +29,11 @@
CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp);
--
--- Table structure for authmap
---
-
-CREATE TABLE authmap (
- aid SERIAL,
- uid integer NOT NULL default '0',
- authname varchar(128) NOT NULL default '',
- module varchar(128) NOT NULL default '',
- PRIMARY KEY (aid),
- UNIQUE (authname)
-);
-
---
--- Table structure for blocks
---
-
-CREATE TABLE blocks (
- module varchar(64) NOT NULL default '',
- delta varchar(32) NOT NULL default '0',
- status smallint NOT NULL default '0',
- weight smallint NOT NULL default '0',
- region smallint NOT NULL default '0',
- path varchar(255) NOT NULL default '',
- custom smallint NOT NULL default '0',
- throttle smallint NOT NULL default '0'
-);
-
---
--- Table structure for book
---
-
-CREATE TABLE book (
- nid integer NOT NULL default '0',
- parent integer NOT NULL default '0',
- weight smallint NOT NULL default '0',
- format smallint default '0',
- log text default '',
- PRIMARY KEY (nid)
-);
-CREATE INDEX book_nid_idx ON book(nid);
-CREATE INDEX book_parent ON book(parent);
-
---
--- Table structure for boxes
---
-
-CREATE TABLE boxes (
- bid SERIAL,
- title varchar(64) NOT NULL default '',
- body text default '',
- info varchar(128) NOT NULL default '',
- type smallint NOT NULL default '0',
- PRIMARY KEY (bid),
- UNIQUE (info),
- UNIQUE (title)
-);
-
---
-- Table structure for table 'aggregator_category'
--
CREATE TABLE aggregator_category (
- cid serial,
+ cid SERIAL,
title varchar(255) NOT NULL default '',
description text NOT NULL,
block smallint NOT NULL default '0',
@@ -124,7 +66,7 @@
--
CREATE TABLE aggregator_feed (
- fid serial,
+ fid SERIAL,
title varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
refresh integer NOT NULL default '0',
@@ -145,7 +87,7 @@
--
CREATE TABLE aggregator_item (
- iid integer NOT NULL auto_increment,
+ iid SERIAL,
fid integer NOT NULL default '0',
title varchar(255) NOT NULL default '',
link varchar(255) NOT NULL default '',
@@ -157,6 +99,65 @@
--
+-- Table structure for authmap
+--
+
+CREATE TABLE authmap (
+ aid SERIAL,
+ uid integer NOT NULL default '0',
+ authname varchar(128) NOT NULL default '',
+ module varchar(128) NOT NULL default '',
+ PRIMARY KEY (aid),
+ UNIQUE (authname)
+);
+
+--
+-- Table structure for blocks
+--
+
+CREATE TABLE blocks (
+ module varchar(64) NOT NULL default '',
+ delta varchar(32) NOT NULL default '0',
+ status smallint NOT NULL default '0',
+ weight smallint NOT NULL default '0',
+ region smallint NOT NULL default '0',
+ path varchar(255) NOT NULL default '',
+ custom smallint NOT NULL default '0',
+ throttle smallint NOT NULL default '0'
+);
+
+--
+-- Table structure for book
+--
+
+CREATE TABLE book (
+ nid integer NOT NULL default '0',
+ parent integer NOT NULL default '0',
+ weight smallint NOT NULL default '0',
+ format smallint default '0',
+ log text default '',
+ PRIMARY KEY (nid)
+);
+CREATE INDEX book_nid_idx ON book(nid);
+CREATE INDEX book_parent ON book(parent);
+
+--
+-- Table structure for boxes
+--
+
+CREATE TABLE boxes (
+ bid SERIAL,
+ title varchar(64) NOT NULL default '',
+ body text default '',
+ info varchar(128) NOT NULL default '',
+ type smallint NOT NULL default '0',
+ PRIMARY KEY (bid),
+ UNIQUE (info),
+ UNIQUE (title)
+);
+
+
+--
-- Table structure for cache
--
@@ -184,6 +185,7 @@
timestamp integer NOT NULL default '0',
score integer NOT NULL default '0',
status smallint NOT NULL default '0',
+ format integer NOT NULL default '0',
thread varchar(255) default '',
users text default '',
name varchar(60) default NULL,
@@ -224,15 +226,31 @@
);
--
+-- Table structure for table 'filter_formats'
+--
+
+CREATE TABLE filter_formats (
+ format SERIAL,
+ name varchar(255) NOT NULL default '',
+ roles varchar(255) NOT NULL default '',
+ cache smallint NOT NULL default '0',
+ PRIMARY KEY (format)
+);
+
+
+--
-- Table structure for table 'filters'
--
CREATE TABLE filters (
+ format integer NOT NULL default '0',
module varchar(64) NOT NULL default '',
- weight smallint DEFAULT '0' NOT NULL,
- PRIMARY KEY (module)
+ delta smallint NOT NULL default '0',
+ weight smallint NOT NULL default '0'
);
+CREATE INDEX filters_weight_idx ON filters(weight);
+
--
-- Table structure for table 'forum'
--
@@ -361,15 +379,16 @@
uid integer NOT NULL default '0',
status integer NOT NULL default '1',
created integer NOT NULL default '0',
+ changed integer NOT NULL default '0',
comment integer NOT NULL default '0',
promote integer NOT NULL default '0',
moderate integer NOT NULL default '0',
users text NOT NULL default '',
teaser text NOT NULL default '',
body text NOT NULL default '',
- changed integer NOT NULL default '0',
revisions text NOT NULL default '',
sticky integer NOT NULL default '0',
+ format integer NOT NULL default '0',
PRIMARY KEY (nid)
);
CREATE INDEX node_type_idx ON node(type);
@@ -386,7 +405,7 @@
--
CREATE TABLE node_access (
- nid SERIAL,
+ nid integer NOT NULL default '0',
gid integer NOT NULL default '0',
realm text NOT NULL default '',
grant_view smallint NOT NULL default '0',
@@ -397,22 +416,7 @@
--
--- Table structure for table 'node_counter'
---
-
-CREATE TABLE node_counter (
- nid integer NOT NULL default '0',
- totalcount integer NOT NULL default '0',
- daycount integer NOT NULL default '0',
- timestamp integer NOT NULL default '0',
- PRIMARY KEY (nid)
-);
-CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount);
-CREATE INDEX node_counter_daycount_idx ON node_counter(daycount);
-CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp);
-
---
--- Table structure for page
+-- Table structure for table 'page'
--
CREATE TABLE page (
@@ -461,9 +465,11 @@
pid serial,
dst varchar(128) NOT NULL default '',
src varchar(128) NOT NULL default '',
- PRIMARY KEY (pid)
+ PRIMARY KEY (pid),
+ UNIQUE (dst)
);
CREATE INDEX url_alias_dst_idx ON url_alias(dst);
+
--
-- Table structure for permission
--
@@ -537,6 +543,9 @@
session text,
PRIMARY KEY (sid)
);
+CREATE INDEX sessions_uid_idx ON sessions(uid);
+CREATE INDEX sessions_sid_idx ON sessions(sid);
+CREATE INDEX sessions_timestamp ON sessions(timestamp);
--
-- Table structure for sequences
@@ -550,6 +559,21 @@
-- );
--
+-- Table structure for table 'node_counter'
+--
+
+CREATE TABLE node_counter (
+ nid integer NOT NULL default '0',
+ totalcount integer NOT NULL default '0',
+ daycount integer NOT NULL default '0',
+ timestamp integer NOT NULL default '0',
+ PRIMARY KEY (nid)
+);
+CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount);
+CREATE INDEX node_counter_daycount_idx ON node_counter(daycount);
+CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp);
+
+--
-- Table structure for system
--
@@ -736,7 +760,7 @@
INSERT INTO filter_formats VALUES (1,'Filtered HTML',',1,2,',1);
INSERT INTO filter_formats VALUES (2,'PHP code','',0);
-INSERT INTO filter_formats VALUES (3,'Full HTML','',1));
+INSERT INTO filter_formats VALUES (3,'Full HTML','',1);
INSERT INTO filters VALUES (1,'filter',0,0);
INSERT INTO filters VALUES (1,'filter',3,1);
INSERT INTO filters VALUES (2,'filter',1,0);
Comments
could you please make a .diff
and create an issue on the bug tracker.
The postgres schema usually lags behind the mysql schema by a couple of weeks. I had updated it before the filter stuff hit though.
database/updates.inc will also need to be updated again I think
What do you mean - make a diff
Not sure what you mean by make a diff - isn't that what the patch file I posted is?
I'll continue this in issues - I am new to this, so I assume you create an issue against the drupal package.
database.pgsql updated in CVS
I just installed a fresh version of Drupal CVS onto my server and had no problems at all. The current tar.gz file does not have the newest files, but if you manually download the files from CVS, you will be fine.