summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-08-01 20:31:50 +0000
committerDries Buytaert <dries@buytaert.net>2009-08-01 20:31:50 +0000
commitb3b7be43c0d9025346a5be2ffa4a995629463e96 (patch)
tree9c3d7b10e7f7eed33e8a7c7cf78f444ec7a94d0b /modules
parente94a448e518e0c2d8ee840e5150d6df8b6714c77 (diff)
downloadbrdo-b3b7be43c0d9025346a5be2ffa4a995629463e96.tar.gz
brdo-b3b7be43c0d9025346a5be2ffa4a995629463e96.tar.bz2
- Patch #342950 by Josh Waihi: moving PostgreSQL stored procedures to the PostgreSQL database backend, where it belongs.
Diffstat (limited to 'modules')
-rw-r--r--modules/system/system.install46
1 files changed, 0 insertions, 46 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index a21d9f503..084248a0c 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -311,52 +311,6 @@ function system_requirements($phase) {
* Implement hook_install().
*/
function system_install() {
- if (db_driver() == 'pgsql') {
- // We create some functions using global names instead of prefixing them
- // like we do with table names. If this function is ever called again (for
- // example, by the test framework when creating prefixed test databases),
- // the global names will already exist. We therefore avoid trying to create
- // them again in that case.
-
- // Create functions.
- db_query('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\''
- );
- db_query('CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric, numeric) RETURNS numeric AS
- \'SELECT greatest($1, greatest($2, $3));\'
- LANGUAGE \'sql\''
- );
- // Don't use {} around pg_proc table.
- if (!db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'rand'")->fetchField()) {
- db_query('CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS
- \'SELECT random();\'
- LANGUAGE \'sql\''
- );
- }
-
- // Don't use {} around pg_proc table.
- if (!db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'concat'")->fetchField()) {
- db_query('CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text AS
- \'SELECT $1 || $2;\'
- LANGUAGE \'sql\''
- );
- }
- db_query('CREATE OR REPLACE FUNCTION "if"(boolean, text, text) RETURNS text AS
- \'SELECT CASE WHEN $1 THEN $2 ELSE $3 END;\'
- LANGUAGE \'sql\''
- );
- db_query('CREATE OR REPLACE FUNCTION "if"(boolean, integer, integer) RETURNS integer AS
- \'SELECT CASE WHEN $1 THEN $2 ELSE $3 END;\'
- LANGUAGE \'sql\''
- );
-
- db_query('CREATE OR REPLACE FUNCTION "substring_index"(text, text, integer) RETURNS text AS
- \'SELECT array_to_string((string_to_array($1, $2)) [1:$3], $2);\'
- LANGUAGE \'sql\''
- );
- }
-
// Create tables.
$modules = array('system', 'filter', 'user', 'node');
foreach ($modules as $module) {