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.
| Attachment | Size |
|---|---|
| spam.pgsql | 1.86 KB |

#1
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
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
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 0warning: 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
The attached patch seems to clear up the last problems.
Thanks for looking into this so quickly.
#5
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