summaryrefslogtreecommitdiff
path: root/database/updates.inc
diff options
context:
space:
mode:
Diffstat (limited to 'database/updates.inc')
-rw-r--r--database/updates.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/database/updates.inc b/database/updates.inc
index f631e121f..ef1d86968 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -65,6 +65,7 @@ $sql_updates = array(
"2004-06-30" => "update_91",
"2004-07-07" => "update_92",
"2004-07-11" => "update_93",
+ "2004-07-22" => "update_94"
);
function update_32() {
@@ -1162,6 +1163,30 @@ function update_93() {
return $ret;
}
+function update_94() {
+ /**
+ * Postgres only update
+ */
+ $ret = array();
+ if ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql('DROP FUNCTION "greatest"(integer, integer)');
+ $ret[] = update_sql("
+ CREATE FUNCTION greatest(integer, integer) RETURNS integer AS '
+ BEGIN
+ IF $2 IS NULL THEN
+ RETURN $1;
+ END IF;
+ IF $1 > $2 THEN
+ RETURN $1;
+ END IF;
+ RETURN $2;
+ END;
+ ' LANGUAGE 'plpgsql';
+ ");
+ }
+ return $ret;
+}
+
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);