How to get DB connection PID from JDBC

From: Oleg Golovanov <rentech(at)mail(dot)ru>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: How to get DB connection PID from JDBC
Date: 2022-09-12 09:13:49
Message-ID: 1662974029.147588580@f112.i.mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Hello
 
There was a need for logging purposes to receive in a Java / Spring application using JDBC, the PID of the connection on the database side. I did not find such an opportunity in the JDBC sources.
 
Can you explain if there is such a possibility?
 
It seems to me to execute when establishing a connection each time a request
select pg_backend_pid()
not the best idea.
 
Best Regards,

Oleg Golovanov
Tel./WhatsApp +79067778133
Moscow, Russia
 

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jorge Solórzano 2022-09-12 13:03:03 Re: How to get DB connection PID from JDBC
Previous Message Dave Cramer 2022-09-08 12:12:19 Re: Postgresql JDBC process consumes more memory with partition tables update delete