Doctrine\DBAL\Platforms\PostgreSqlPlatform::getCloseActiveDatabaseConnectionsSQL PHP Method

getCloseActiveDatabaseConnectionsSQL() public method

This is useful to force DROP DATABASE operations which could fail because of active connections.
public getCloseActiveDatabaseConnectionsSQL ( string $database ) : string
$database string The name of the database to close currently active connections for.
return string
    public function getCloseActiveDatabaseConnectionsSQL($database)
    {
        $database = $this->quoteStringLiteral($database);
        return "SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname = {$database}";
    }
PostgreSqlPlatform