Commit 350f2e5a authored by Dries's avatar Dries

- Patch #37383 by Cvbge: fixed clash between greatest() functions from Drupal...

- Patch #37383 by Cvbge: fixed clash between greatest() functions from Drupal and postgresql 8.1.  Removed dependency on plpgsql.
parent 70eb349d
......@@ -49,6 +49,8 @@ Drupal x.x.x, xxxx-xx-xx (development version)
* made indexer smarter and more robust
* added advanced search operators (e.g. phrase, node type, ...)
* added customizable result ranking
- PostgreSQL support:
* removed dependency on PL/pgSQL procedural language
Drupal 4.6.3, 2005-08-15
------------------------
......
-- Do not show NOTICE: messages, it's hard to spot errors.
set client_min_messages = 'warning';
--
-- Table structure for access
--
......@@ -869,35 +872,23 @@ ALTER SEQUENCE menu_mid_seq RESTART 3;
--- Functions
---
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';
CREATE FUNCTION greatest(integer, integer, integer) RETURNS integer AS '
CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric) RETURNS numeric AS '
SELECT CASE WHEN (($1 > $2) OR ($2 IS NULL)) THEN $1 ELSE $2 END;
' LANGUAGE 'sql';
CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric, numeric) RETURNS numeric AS '
SELECT greatest($1, greatest($2, $3));
' LANGUAGE 'sql';
CREATE FUNCTION "rand"() RETURNS float AS '
BEGIN
RETURN random();
END;
' LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS '
SELECT random();
' LANGUAGE 'sql';
CREATE FUNCTION "concat"(text, text) RETURNS text AS '
BEGIN
RETURN $1 || $2;
END;
' LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text AS '
SELECT $1 || $2;
' LANGUAGE 'sql';
CREATE FUNCTION "if"(boolean, anyelement, anyelement) RETURNS anyelement AS '
CREATE OR REPLACE FUNCTION "if"(boolean, anyelement, anyelement) RETURNS anyelement AS '
SELECT CASE WHEN $1 THEN $2 ELSE $3 END;
' LANGUAGE 'sql';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment