From 4421a0bb2f20690fe946ab770f42b50d31346fd2 Mon Sep 17 00:00:00 2001 From: chriskl Date: Sat, 21 Jun 2003 09:54:37 +0000 Subject: [PATCH] fix setof functions in < 7.3 and fix for functions returnign trigger type, etc. --- classes/database/Postgres.php | 7 ++++--- classes/database/Postgres73.php | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index ca362b5c..a1e318a1 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres.php,v 1.125 2003/06/19 01:45:09 chriskl Exp $ + * $Id: Postgres.php,v 1.126 2003/06/21 09:54:37 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -2379,7 +2379,6 @@ class Postgres extends BaseDB { function createFunction($funcname, $args, $returns, $definition, $language, $flags, $setof, $replace = false) { $this->fieldClean($funcname); $this->clean($args); - $this->fieldClean($returns); $this->clean($definition); $this->clean($language); $this->arrayClean($flags); @@ -2392,7 +2391,9 @@ class Postgres extends BaseDB { $sql .= $args; // For some reason, the returns field cannot have quotes... - $sql .= ") RETURNS {$returns} AS '\n"; + $sql .= ") RETURNS "; + if ($setof) $sql .= "SETOF "; + $sql .= "{$returns} AS '\n"; $sql .= $definition; $sql .= "\n'"; $sql .= " LANGUAGE '{$language}'"; diff --git a/classes/database/Postgres73.php b/classes/database/Postgres73.php index ae310556..04ba5e6d 100644 --- a/classes/database/Postgres73.php +++ b/classes/database/Postgres73.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres73.php,v 1.47 2003/05/31 10:55:41 chriskl Exp $ + * $Id: Postgres73.php,v 1.48 2003/06/21 09:54:37 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -586,7 +586,6 @@ class Postgres73 extends Postgres72 { function createFunction($funcname, $args, $returns, $definition, $language, $flags, $setof, $replace = false) { $this->fieldClean($funcname); $this->clean($args); - $this->fieldClean($returns); $this->clean($definition); $this->clean($language); $this->arrayClean($flags); -- 2.39.5