PostgreSQL Support

antgel - July 13, 2008 - 13:55
Project:Spam
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi, I'm getting the following errors when I try to install Spam API. Drupal 5.7, postgresql 8.1.11. Let me know if you need any more information about my setup.

* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_tracker" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: ALTER TABLE spam_tracker RENAME TO old_spam_tracker in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_tokens" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: ALTER TABLE spam_tokens RENAME TO old_spam_tokens in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_custom" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: ALTER TABLE spam_custom RENAME TO old_spam_custom in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_reported" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: ALTER TABLE spam_reported RENAME TO old_spam_reported in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_log" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: ALTER TABLE spam_log RENAME TO old_spam_log in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" at character 71 in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE spam_log ( lid serial PRIMARY KEY, trid integer UNSIGNED NOT NULL DEFAULT '0', level integer UNSIGNED NOT NULL DEFAULT '0', content_type varchar(128) NOT NULL default '', content_id integer NOT NULL default 0, function varchar(255) NOT NULL default '', uid integer NOT NULL default 0, message varchar(255) NOT NULL default '', timestamp integer NOT NULL default 0 ); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_log" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX spam_log_sid_key ON spam_log (sid); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_log" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX spam_log_trid_key ON spam_log (trid); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_log" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX spam_log_timestamp_key ON spam_log (timestamp); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "UNSIGNED" at character 133 in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE TABLE spam_statistics ( stid serial PRIMARY KEY, name varchar(64) NOT NULL DEFAULT '', count integer UNSIGNED NOT NULL DEFAULT '0', timestamp integer UNSIGNED DEFAULT '0', CONSTRAINT spam_statistics_u UNIQUE(name) ); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "spam_statistics" does not exist in /usr/share/drupal5/includes/database.pgsql.inc on line 125.
* user warning: query: CREATE INDEX spam_statistics_u_key ON spam_statistics (name); in /usr/share/drupal5/includes/database.pgsql.inc on line 144.

#1

Jeremy - July 25, 2008 - 00:16
Title:Problems installing module with postgresql» PostgreSQL Support
Version:5.x-3.0-alpha5» 5.x-3.x-dev
Priority:critical» normal

No effort has yet been put into making this version of the spam module support PostgreSQL. Patches welcome!

#2

Jeremy - September 17, 2008 - 15:19
Status:active» postponed

Issue postponed until someone steps up to maintain support for postgresql. Please re-open issue with patches.

#3

jaydub - September 27, 2008 - 04:18
Status:postponed» needs review

Here is a start.

Didn't get to updating any of the hook_update_N functions yet.
Also haven't been able to test extensively but at least all modules
install cleanly and a cursory check of the spam module admin pages
all work.

AttachmentSize
bayesian.install.282062.patch 1.76 KB
duplicate.install.282062.patch 2.25 KB
duplicate.module.282062.patch 1.34 KB
spam.install.282062.patch 8.84 KB

#4

Jeremy - September 27, 2008 - 12:15

Thanks! I'll try and take a look at the patches very soon.

#5

Jeremy - September 29, 2008 - 16:20
Status:needs review» needs work

I committed three of your four patches, updating all the .install files. Thanks! Unfortunately your patch to duplicate.module breaks the functionality, and the query no longer returns the data that it's supposed to. Quite honestly, that query should be completely re-written to be less complex, so perhaps it's not worth trying to fix in this issue.

However, still needed for complete PostgreSQL support is a patch for custom.install, and for spam_upgrade_0 (the other updates can be skipped IMO, but update 0 is important for anyone migrating from the 5.x-1.x spam module).

Thanks again for your patches!

#6

Jeremy - September 29, 2008 - 16:32

I had to revert the patch for spam.install, as it broke upgrades from 5.x-1.x. Your path was based off an older, broken version of spam.install.

#7

Jeremy - August 7, 2009 - 01:41
Version:5.x-3.x-dev» 6.x-1.x-dev
Status:needs work» fixed

The 6.x branch of the spam module uses the Schema API, which means it will install on PostgreSQL without any problems. Marking as fixed.

#8

System Message - August 21, 2009 - 01:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.