简体   繁体   中英

Is it possible to get all the connections made to the database by Npgsql?

If possible, i would like to get all the connections made by Npgsql to the PostgreSql database. And in turn, select a particular connection based on its PID.

Npgsql tracks all connections in use internally in its connection pool, but this isn't exposed to the user in any way. You could track the NpgsqlConnection objects you create in your own code outside of Npgsql.

Once you have NpgsqlConnection instances, you can get the backend process ID with the ProcessID property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM