Обсуждение: PID for the conection

Поиск
Список
Период
Сортировка

PID for the conection

От
"Jose G. Mendoza"
Дата:

How can I obtain the PID for each thread or user connection to the PostgreSQL from the client side?

I’m using the odbc to connect the client application to the PostgreSQL.

 

 

 

Re: PID for the conection

От
Richard Huxton
Дата:
On Thursday 15 January 2004 06:44, Jose G. Mendoza wrote:
> How can I obtain the PID for each thread or user connection to the
> PostgreSQL from the client side?
> I'm using the odbc to connect the client application to the PostgreSQL.

Is this what you're after?

SELECT * FROM pg_stat_activity ;
 datid | datname  | procpid | usesysid | usename  | current_query
-------+----------+---------+----------+----------+---------------
 17048 | richardh |   30681 |      100 | richardh | <IDLE>

--
  Richard Huxton
  Archonet Ltd