Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add application_name to PostgreSQL driver connection #798

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ pdo\_pgsql
a SSL TCP/IP connection will be negotiated with the server.
See the list of available modes:
`http://www.postgresql.org/docs/9.1/static/libpq-connect.html#LIBPQ-CONNECT-SSLMODE`
- ``application_name`` (string): Name of the application that is
connecting to database. Optional. It will be displayed at ``pg_stat_activity``.

PostgreSQL behaves differently with regard to booleans when you use
``PDO::ATTR_EMULATE_PREPARES`` or not. To switch from using ``'true'``
Expand Down Expand Up @@ -285,7 +287,7 @@ pdo\_oci / oci8
database.
- ``instancename`` (string): Optional parameter, complete whether to
add the INSTANCE_NAME parameter in the connection. It is generally used
to connect to an Oracle RAC server to select the name of a particular instance.
to connect to an Oracle RAC server to select the name of a particular instance.


pdo\_sqlsrv / sqlsrv
Expand Down
4 changes: 4 additions & 0 deletions lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ private function _constructPdoDsn(array $params)
$dsn .= 'sslmode=' . $params['sslmode'] . ' ';
}

if (isset($params['application_name'])) {
$dsn .= 'application_name=' . $params['application_name'] . ' ';
}

return $dsn;
}

Expand Down