$same = $this->getVar( 'wgDBuser' ) === $this->getVar( '_InstallUser' );
- // Check if the web user exists
- // Connect to the database with the install user
- $status = $this->getPgConnection( 'create-db' );
- if ( !$status->isOK() ) {
- return $status;
+ if ( $same ) {
+ $exists = true;
+ } else {
+ // Check if the web user exists
+ // Connect to the database with the install user
+ $status = $this->getPgConnection( 'create-db' );
+ if ( !$status->isOK() ) {
+ return $status;
+ }
+ $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
}
- $exists = $status->value->roleExists( $this->getVar( 'wgDBuser' ) );
// Validate the create checkbox
if ( $this->canCreateAccounts() && !$same && !$exists ) {
// The web user is conventionally the table owner in PostgreSQL
// installations. Make sure the install user is able to create
// objects on behalf of the web user.
- if ( $this->canCreateObjectsForWebUser() ) {
+ if ( $same || $this->canCreateObjectsForWebUser() ) {
return Status::newGood();
} else {
return Status::newFatal( 'config-pg-not-in-role' );