Author |
Message |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
[postgresql] application identifier |
|
Postgresql since v.9 has ability to report application name on connection list.
The list is available by calling query:
 |
 |
SELECT * FROM pg_stat_activity |
Resultset contains applicaton_name column.
App name can be set in native clients passing application_name atribute, or sending following SQL query:
 |
 |
SET application_name = 'SQL Editor'; |
IMO each query sent to database should be signed with proper application name. It means, best place to set up the name is just after established connection (to make it once).
Please note, this feature is available since postgresql 9.0. Calling this statement against older server will cause SQL error.
|
|
Fri Oct 23, 2015 7:52 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Is that possible to add that to the database connection string?
If you use an ODBC profile (DSN) instead of direct connection, can you set it in the profile settings?
|
|
Mon Oct 26, 2015 9:46 am |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
Indeed, it's possible.
I edited raw connection string available in connection popup, adding following line:
ConnSettings={set application_name to 'my application'};
But I cannot see possibility to define additional parameters in db options/db connections.
|
|
Tue Nov 03, 2015 6:12 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Hi. Which additional parameters are desired?
|
|
Tue Nov 03, 2015 9:36 am |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
I'm afraid I don't get the question's intention.
There is no (or I cannot find) a place for additional parameters to be passed via connection string. It might be items list or even simple string box allowing extension of connection string by adding custom part.
I can extend connection string editing raw connection string though, but IMO it's not a proper place as well as not convenient one
|
|
Tue Nov 03, 2015 10:12 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I see, you are asking in general if it's possible to add additional parameters. Yes, you can do it it in the raw parameters section. On the Connect to Database dialog click "Show Raw Connection String" link, and add your changes. This feature is available for ODBC and ADO.NET connections. It's not available for OCI and MySQL native driver connections.
|
|
Tue Nov 03, 2015 10:22 am |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
Please, read again the first post. In the first row I'm talking about ability of setting application_name which can be reported by postgresql system functions. I don't know if other dbs have similar feature (mysql don't). This is the main goal. I found a way how to set it up with odbc connection string, but I don't want to work with that this way.
Yes I know the raw parameters options. But it's not proper nor comfy place to play with. Especially since I have a dozen of connections which forces me to define each connection in 2 different places.
Since content of connection window (in DB options / DB connections) depends on connection method selected, it could be possible to add additional field for connection string extension. I think it would be most flexible solution (across all databases) for requirement given in the first post, giving additional possibilities at the same time.
|
|
Tue Nov 03, 2015 10:36 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I think I'm starting to see what you mean. You're saying it would be more convenient to add any custom connection values in the Options dialog in DB Connections settings where you can manage them all in one place. Please confirm that's what you're asking for, I will submit an enhancement request to provide an additional field for custom connection parameters to be added to the connection string.
|
|
Tue Nov 03, 2015 11:20 am |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
Yes, this is exactly what I meant.
Thank you.
|
|
Tue Nov 03, 2015 11:38 am |
|
 |
|