1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge branch '3.3.x'

This commit is contained in:
Marc Alexander
2021-05-01 21:52:12 +02:00
13 changed files with 156 additions and 21 deletions

View File

@@ -96,6 +96,24 @@ class postgres extends tools
return $tables;
}
/**
* {@inheritDoc}
*/
function sql_table_exists($table_name)
{
$sql = "SELECT CAST(EXISTS(
SELECT FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name = '" . $this->db->sql_escape($table_name) . "'
) AS INTEGER)";
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$table_exists = (booL) $row['exists'];
$this->db->sql_freeresult($result);
return $table_exists;
}
/**
* {@inheritDoc}
*/