Re: select count(*) from pg_stat_activity in V8.0.0

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: select count(*) from pg_stat_activity in V8.0.0
Дата
Msg-id 412462D1.20102@archonet.com
обсуждение исходный текст
Ответ на select count(*) from pg_stat_activity in V8.0.0  ("Anony Mous" <A.Mous@shaw.ca>)
Ответы Re: select count(*) from pg_stat_activity in V8.0.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: select count(*) from pg_stat_activity in V8.0.0  ("Anony Mous" <A.Mous@shaw.ca>)
Re: select count(*) from pg_stat_activity in V8.0.0  ("peter@remindex" <peter@remindex.com>)
Список pgsql-general
Anony Mous wrote:
> Coming off of 7.4.3 I've always used
>
> select count(*) from pg_stat_activity
>
> through the ODBC driver to obtain the number of connections to the db.  I've
> found that with v8.0 Beta 1 that this at times has returned a value of 0
> (when there is obviously still a connection).  It's not repeatable, and
> occurs sporadically.  Does anyone have any reason as to why this would be
> isolated to V8?  Is this an acceptable means of obtaining the number of
> connection to the database in V8 (via ODBC).

Do you have multiple live connections? My understanding of
pg_stat_activity is that it can lag slightly behind the current state of
the system. If the only connection that is active is the one doing the
counting you could be checking before the table has been updated.

--
   Richard Huxton
   Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Vacuum, per table or entire database? what is better?
Следующее
От: Fuchs Clemens
Дата:
Сообщение: Pass parameters to SQL script