Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how many are connected?

Status
Not open for further replies.

cromulent

Programmer
Oct 8, 2004
8
US
Does postgres keep track of how many open connections there are at any given time? And particularly, how many connections to a given database? I have been using npgsql with c# for a corporate application and would like to get this information from the database. Is this possible?

Thanks for any help,

A
 
select * from pg_stat_activity ;

you will have to tweek with this options

#stats_start_collector = true
#stats_command_string = false
#stats_block_level = false
#stats_row_level = false
#stats_reset_on_server_start = true

from the postgresql.conf file (and don't forget that after changing an option you need pg_ctl reload)

this should work for 8.0.x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top