* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.79 2003/04/23 08:56:26 chriskl Exp $
+ * $Id: Postgres.php,v 1.80 2003/04/28 12:00:54 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function Postgres($host, $port, $database, $user, $password) {
$this->BaseDB('postgres7');
- $pghost = "{$host}:{$port}";
- if ($database === null) $database = 'template1';
+ // Ignore host if null
+ if ($host === null || $host == '')
+ $pghost = '';
+ else
+ $pghost = "{$host}:{$port}";
+
+ if ($database === null || $database == '') $database = 'template1';
$this->conn->connect($pghost, $user, $password, $database);
}
/**
* Removes a rule from a relation
* @param $rule The rule to drop
- * @param $relation The relation from which to drop
+ * @param $relation The relation from which to drop (unused)
* @return 0 success
*/
function dropRule($rule, $relation) {
$this->fieldClean($rule);
- $this->fieldClean($relation);
- $sql = "DROP RULE \"{$rule}\" ON \"{$relation}\"";
+ $sql = "DROP RULE \"{$rule}\"";
return $this->execute($sql);
}
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres73.php,v 1.34 2003/03/28 12:29:53 chriskl Exp $
+ * $Id: Postgres73.php,v 1.35 2003/04/28 12:00:56 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
}
// Rule functions
+
+ /**
+ * Removes a rule from a relation
+ * @param $rule The rule to drop
+ * @param $relation The relation from which to drop
+ * @return 0 success
+ */
+ function dropRule($rule, $relation) {
+ $this->fieldClean($rule);
+ $this->fieldClean($relation);
+
+ $sql = "DROP RULE \"{$rule}\" ON \"{$relation}\"";
+
+ return $this->execute($sql);
+ }
/**
* Returns a list of all rules on a table