PostgreSQL support

Zed Pobre - January 16, 2005 - 10:35
Project:Spam
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Attached is a spam.pgsql file that seems to work for me.

AttachmentSize
spam.pgsql1.86 KB

#1

Zed Pobre - January 16, 2005 - 10:47

There are additional problems in spam.module itself, it seems. In PostgreSQL, ' and " have different meanings, and you use " (which is used in PostgreSQL for selecting columns) when you generally need to use ' (which is used for specifying a string).

Unfortunately, fixing this is going to be somewhat tedious, since these characters are generally embedded in another string... which used the opposite style of quote to begin and end, and thus must be reversed as well.

#2

Anonymous - January 19, 2005 - 19:28

Thanks! spam.pgsql is committed and spam.module is updated to use " for strings in db_queries. The change is only committed to the CVS version at the moment -- please test and confirm that everything works as intended.

#3

Zed Pobre - January 22, 2005 - 09:09

Great progress has been made, but it's not completely fixed yet. I was able to successfully mark a number of comments as not spam, but when I tried changing the status from not spam to spam on one of the comments as a test, I got:

user error: query: SELECT * FROM spam_tokens WHERE probability > 80 AND token LIKE "URL%%" ORDER BY token ASC LIMIT 25 OFFSET 0
warning: pg_query(): Query failed: ERROR: column "URL%%" does not exist
user error: query: SELECT COUNT(*) FROM spam_tokens WHERE probability > 80 AND token LIKE "URL%%"
warning: pg_query(): Query failed: ERROR: column "URL%%" does not exist

#4

Zed Pobre - January 22, 2005 - 09:16

The attached patch seems to clear up the last problems.

Thanks for looking into this so quickly.

AttachmentSize
spam.patch 521 bytes

#5

Jeremy - January 22, 2005 - 15:22

Fixes commited to cvs head and the 4.5 version of the spam module. Thanks! If you run into any further PostgreSQL support issues, please let me know.

#6

Anonymous - February 5, 2005 - 16:15
 
 

Drupal is a registered trademark of Dries Buytaert.