Skip to content

Commit

Permalink
Merge pull request #10059 from mwain/5.1
Browse files Browse the repository at this point in the history
[5.1] PostgresConnector set application_name for a connection
  • Loading branch information
taylorotwell committed Aug 28, 2015
2 parents 5288aed + 05cfed0 commit 87dbd73
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Connectors/PostgresConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public function connect(array $config)
$connection->prepare("set search_path to {$schema}")->execute();
}

// In Postgres the name of the application can be set by the user.
// This is useful for monitoring.
if (isset($config['application_name'])) {
$applicationName = $config['application_name'];

$connection->prepare("set application_name to '$applicationName'")->execute();
}

return $connection;
}

Expand Down

0 comments on commit 87dbd73

Please sign in to comment.