Only set application_name if it's different (#74)

* Only set application_name if it's different

* keep server named pgcat until something else changes
This commit is contained in:
Lev Kokotov
2022-06-05 09:48:06 -07:00
committed by GitHub
parent 37e3a86881
commit bac4e1f52c
2 changed files with 20 additions and 5 deletions

View File

@@ -369,6 +369,7 @@ impl Client {
if server.in_transaction() {
server.query("ROLLBACK").await?;
server.query("DISCARD ALL").await?;
server.set_name("pgcat").await?;
}
return Err(err);
@@ -440,6 +441,7 @@ impl Client {
if server.in_transaction() {
server.query("ROLLBACK").await?;
server.query("DISCARD ALL").await?;
server.set_name("pgcat").await?;
}
self.release();