SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[postgresql] application identifier

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[postgresql] application identifier
Author Message
michalk



Joined: 29 Aug 2014
Posts: 211

Post [postgresql] application identifier Reply with quote
Postgresql since v.9 has ability to report application name on connection list.
The list is available by calling query:
Code:
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:
Quote:
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Hi. Which additional parameters are desired?
Tue Nov 03, 2015 9:36 am View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
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 View user's profile Send private message
michalk



Joined: 29 Aug 2014
Posts: 211

Post Reply with quote
Yes, this is exactly what I meant.
Thank you.
Tue Nov 03, 2015 11:38 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.