Use proper ALTER ROLE syntax

Fixes #1260

See https://www.postgresql.org/docs/9.0/static/sql-alterrole.html
This commit is contained in:
Roeland Jago Douma 2016-09-05 10:45:11 +02:00 committed by Joas Schilling
parent 6849d7235e
commit 113a743b91
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class PostgreSQL extends AbstractDatabase {
try {
if ($this->userExists($connection)) {
// change the password
$query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " CREATEDB WITH PASSWORD '" . addslashes($this->dbPassword) . "'");
$query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " WITH CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
} else {
// create the user
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");