Update DB\Pgsql
This commit is contained in:
parent
fac9ef1c8d
commit
d2ec24e6b9
1 changed files with 13 additions and 3 deletions
|
@ -487,13 +487,23 @@ class Pgsql
|
|||
$size += $row['relpages'];
|
||||
}
|
||||
|
||||
$blockSize = $this->db->query('SELECT current_setting(\'block_size\')')->fetchColumn();
|
||||
$size *= $blockSize ?: 8192;
|
||||
|
||||
$other = [
|
||||
'pg_database_size' => $this->db->query('SELECT pg_size_pretty(pg_database_size(current_database()))')->fetchColumn(),
|
||||
];
|
||||
|
||||
$stmt = $this->db->query('SHOW ALL');
|
||||
|
||||
while ($row = $stmt->fetch()) {
|
||||
if ('block_size' === $row['name']) {
|
||||
$blockSize = (int) $row['setting'];
|
||||
} elseif (\preg_match('%^lc_|_encoding%', $row['name'])) {
|
||||
$other[$row['name']] = $row['setting'];
|
||||
}
|
||||
}
|
||||
|
||||
// $blockSize = $this->db->query('SELECT current_setting(\'block_size\')')->fetchColumn();
|
||||
$size *= $blockSize ?: 8192;
|
||||
|
||||
return [
|
||||
'db' => 'PostgreSQL (PDO) v.' . $this->db->getAttribute(PDO::ATTR_SERVER_VERSION),
|
||||
'tables' => (string) $tables,
|
||||
|
|
Loading…
Add table
Reference in a new issue