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 support to set PostgreSQL application_name #386

Merged
merged 3 commits into from
Jan 10, 2016

Conversation

davividal
Copy link
Contributor

This PR is dependant upon doctrine/dbal#798 .
PostgreSQL allows the user to set the application_name is connecting
to database. It is useful for monitoring purposes.
Currently one could just manually add 'application_name=foo' to DSN
by appending it to dbname, like:

dbname: %database_name% application_name=foo

It works but having a parameter eases setting it.

This PR is dependant upon doctrine/dbal#798 .
PostgreSQL allows the user to set the application_name is connecting
to database. It is useful for monitoring purposes.
Currently one could just manually add 'application_name=foo' to DSN
by appending it to dbname, like:

dbname:   %database_name% application_name=foo

It works but having a parameter eases setting it.
@@ -47,6 +47,7 @@
<xsd:attribute name="port" type="xsd:string" />
<xsd:attribute name="user" type="xsd:string" />
<xsd:attribute name="password" type="xsd:string" />
<xsd:attribute name="application_name" type="xsd:string" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be application-name to be consistent with the other options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, but the GUC variable and the DSN part is called application_name. Wouldn't it make more sense for the users?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the XML format always uses dashes in places where YAML uses underscores (it is normalized by the config system). What makes sense for users is to respect the XML convention (they will get autocompletion based on the XSD in their IDE anyway)

@davividal
Copy link
Contributor Author

@xabbuh @stof what about now?

@stof
Copy link
Member

stof commented Feb 28, 2015

Well, it cannot be merged here until the DBAL team merges the feature in DBAL itself

kimhemsoe added a commit that referenced this pull request Jan 10, 2016
Add support to set PostgreSQL application_name
@kimhemsoe kimhemsoe merged commit da0ac5e into doctrine:master Jan 10, 2016
@kimhemsoe
Copy link
Member

Thanks @davividal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants