Making the Akismet module work for Drupal on PostgreSQL
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Drupal Modules
View previous topic :: View next topic  
Author Message
ChrisHardie
Starter
Starter


Joined: 04 Nov 2006
Posts: 1

PostPosted: Sat Nov 04, 2006 7:56 pm    Post subject: Making the Akismet module work for Drupal on PostgreSQL Reply with quote

The Akismet module version 1.1.2 for Drupal 4.7 uses a SQL function that is specific to MySQL: IFNULL(). The result is that if you try to use the vanilla install of the module on a site that is using PostgreSQL as the backend, you'll get an error in the administrative interface.

Ideally the module code should be as database independent as possible, which should be easy since this appears to be the only case where a MySQL-specific function is used. But, for those of you who want a quick fix in the meantime, you can create a local IFNULL function in PostgreSQL that will make the module start working:

Code:
drop function ifnull (text, text);
create function ifnull (text, text) returns text AS 'select coalesce($1, $2) as result ' language 'sql';

drop function ifnull (int4, int4);
create function ifnull (int4, int4) returns int4 as 'select coalesce($1, $2) as result' language 'sql';


Just open up psql and connect to your database and run the above statements. Your mileage may vary depending on your database version and any other customizations you've made.

I hope this helps.

Chris

--
http://www.chrishardie.com/
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Drupal Modules All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum