From d69d75e456ef1d40cfb9ba901bd9a818ec8b4805 Mon Sep 17 00:00:00 2001 From: ioguix Date: Tue, 25 Sep 2007 09:53:11 +0000 Subject: [PATCH] update method clusterIndex for pg83. To test! --- classes/database/Postgres83.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/classes/database/Postgres83.php b/classes/database/Postgres83.php index 5be05103..94aa521b 100644 --- a/classes/database/Postgres83.php +++ b/classes/database/Postgres83.php @@ -3,7 +3,7 @@ /** * PostgreSQL 8.3 support * - * $Id: Postgres83.php,v 1.6 2007/09/18 05:03:29 xzilla Exp $ + * $Id: Postgres83.php,v 1.7 2007/09/25 09:53:11 ioguix Exp $ */ include_once('./classes/database/Postgres82.php'); @@ -133,6 +133,26 @@ class Postgres83 extends Postgres82 { return $this->endTransaction(); } + // Indexe functions + + /** + * Clusters an index + * @param $index The name of the index + * @param $table The table the index is on + * @return 0 success + */ + function clusterIndex($index, $table) { + + $this->fieldClean($index); + $this->fieldClean($table); + + // We don't bother with a transaction here, as there's no point rolling + // back an expensive cluster if a cheap analyze fails for whatever reason + $sql = "CLUSTER \"{$table}\" USING \"{$index}\""; + + return $this->execute($sql); + } + // Operator Class functions /** -- 2.39.5