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 {
342
342
server. address( )
343
343
) ;
344
344
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
+
345
353
// Transaction loop. Multiple queries can be issued by the client here.
346
354
// The connection belongs to the client until the transaction is over,
347
355
// or until the client disconnects if we are in session mode.
Original file line number Diff line number Diff line change 16
16
username : 'sharding_user' ,
17
17
password : 'sharding_user' ,
18
18
database : 'rails_dev' ,
19
+ application_name : 'testing_pgcat' ,
19
20
prepared_statements : false , # Transaction mode
20
21
advisory_locks : false # Same
21
22
)
@@ -116,7 +117,7 @@ def down
116
117
117
118
# Test evil clients
118
119
def 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 " )
120
121
conn . async_exec 'BEGIN'
121
122
conn . async_exec 'SELECT 1'
122
123
You can’t perform that action at this time.
0 commit comments