Re: implement query_start for pg_stat_activity

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: implement query_start for pg_stat_activity
Дата
Msg-id
200303142048.h2EKmCZ24578@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
implement query_start for pg_stat_activity Neil Conway <neilc@samurai.com>
Re: implement query_start for pg_stat_activity Neil Conway <neilc@samurai.com>
Re: implement query_start for pg_stat_activity Bruce Momjian <pgman@candle.pha.pa.us>
Re: implement query_start for pg_stat_activity Bruce Momjian <pgman@candle.pha.pa.us>
Re: implement query_start for pg_stat_activity Bruce Momjian <pgman@candle.pha.pa.us>
Re: implement query_start for pg_stat_activity Tom Lane <tgl@sss.pgh.pa.us>
Re: implement query_start for pg_stat_activity Tom Lane <tgl@sss.pgh.pa.us>
Re: implement query_start for pg_stat_activity Neil Conway <neilc@samurai.com>
Re: implement query_start for pg_stat_activity Rod Taylor <rbt@rbt.ca>
Re: implement query_start for pg_stat_activity Tom Lane <tgl@sss.pgh.pa.us>

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Neil Conway wrote:
> On Wed, 2003-02-19 at 00:27, Neil Conway wrote:
> > This patch implements the TODO item
> > 
> >     - Add start time to pg_stat_activity
> 
> I've attached a revised version of the patch with the following changes:
> 
> - use longer function names, as suggested by Tom
> 
> - (unrelated) replace some instances where snprintf() was called with a
> constant buffer size with sizeof
> 
> - documentation improvements
> 
> - update regression tests
> 
> - change the method of finding the current date & time -- it's still an
> ugly hack, although arguably less so. Now we do:
> 
> AbsoluteTime sec;
> int usec;
> 
> sec = GetCurrentAbsoluteTimeUsec(&usec);
> 
> /* when displaying the time */
> Timestamp result;
> 
> #ifdef HAVE_INT64_TIMESTAMP
> result = (((sec - ((date2j(2000, 1, 1) - date2j(1970, 1, 1)) * 86400))
> 		   * INT64CONST(1000000)) + usec);
> #else
> result = (sec + (usec * 1.0e-6) - ((date2j(2000, 1, 1) -
> 				date2j(1970, 1, 1)) * 86400));
> #endif
> 
> which is the same method now() uses internally.
> 
> Cheers,
> 
> Neil
> -- 
> Neil Conway  || PGP Key ID: DB3C29FC
> 
> 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
В списке pgsql-patches по дате отправления
От: Bruce Momjian
Дата:
Сообщение: Re: fix tiny psql memory leak
От: Alvaro Herrera
Дата:
Сообщение: Re: Dump CLUSTER in pg_dump
FAQ