File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -342,6 +342,14 @@ impl Client {
342342 server. address( )
343343 ) ;
344344
345+ // Set application_name if any.
346+ // TODO: investigate other parameters and set them too.
347+ if self . parameters . contains_key ( "application_name" ) {
348+ server
349+ . set_name ( & self . parameters [ "application_name" ] )
350+ . await ?;
351+ }
352+
345353 // Transaction loop. Multiple queries can be issued by the client here.
346354 // The connection belongs to the client until the transaction is over,
347355 // or until the client disconnects if we are in session mode.
Original file line number Diff line number Diff line change 1616 username : 'sharding_user' ,
1717 password : 'sharding_user' ,
1818 database : 'rails_dev' ,
19+ application_name : 'testing_pgcat' ,
1920 prepared_statements : false , # Transaction mode
2021 advisory_locks : false # Same
2122)
@@ -116,7 +117,7 @@ def down
116117
117118# Test evil clients
118119def poorly_behaved_client
119- conn = PG ::connect ( "postgres://sharding_user:sharding_user@127.0.0.1:6432/rails_dev" )
120+ conn = PG ::connect ( "postgres://sharding_user:sharding_user@127.0.0.1:6432/rails_dev?application_name=testing_pgcat " )
120121 conn . async_exec 'BEGIN'
121122 conn . async_exec 'SELECT 1'
122123
You can’t perform that action at this time.
0 commit comments