I use PostgreSQL 7.4 database with DRUPAL 5. In this database there is no function greatest() which is used in node.module for search queries. For compatibility we need some solution for this.
CREATE OR REPLACE FUNCTION greatest(anyelement,anyelement) RETURNS anyelement AS '
SELECT CASE WHEN $1 > $2 THEN $1 ELSE $2 END
' LANGUAGE 'sql';
And for three parameters:
CREATE OR REPLACE FUNCTION greatest(anyelement,anyelement,anyelement) RETURNS anyelement AS '
SELECT CASE WHEN $1 > greatest($2, $3) THEN $1 ELSE greatest($2, $3) END
' LANGUAGE 'sql';
Comments
Comment #1
chx commentedInteresting. This function can be found in system_update_125 but nowhere else.
Comment #2
sammys commentedHi @havran,
Thanks for posting this issue! A very important one indeed.
It appears that I left the functions out of system.install when I created the install system code for 5.0. Here is a patch that i've tested on pgsql 7.4 and it'll no doubt work on all the others as well. I simply reused the function defs from 4.7, wrapped them in db_query's and avoided replacing the concat() and rand() functions if they already exist on the system (they do in pgsql 7.4)
Cheers,
--
Sammy Spets
Synerger
http://synerger.com
Comment #3
dries commentedCommitted to trunk.
Comment #4
yched commentedIsn't there a mistake in the patch ?
should probably be
Comment #5
yched commentedpatch attached
Comment #6
dries commentedCommitted to CVS HEAD. Thanks.
Comment #7
sammys commented