ENHANCEMENT: implemented missing hasTable method that returns if a given table exists in the postgres database.

This commit is contained in:
Sam Minnee 2010-06-03 05:02:11 +00:00
parent 0d090e971f
commit a536ee1821

View File

@ -1180,10 +1180,11 @@ class PostgreSQLDatabase extends SS_Database {
/**
* Returns true if this table exists
* @todo Make a proper implementation
*/
function hasTable($tableName) {
return true;
$result = $this->query("SELECT tablename FROM pg_tables WHERE tablename = '$tableName'");
if ($result->numRecords() > 0) return true;
else return false;
}
/**