Re: microsecond log timestamps

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pggeneral <pgsql-general(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: microsecond log timestamps
Date: 2001-05-13 05:47:55
Message-ID: 3AFE200B.79FE9631@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

Tom Lane wrote:
>
> Ed Loehr <eloehr(at)austin(dot)rr(dot)com> writes:
> > Someone probably had a good reason for doing this, but looking at
> > backend/utils/error/elog.c line 592 in 7.1, it looks like the pre-7.1
> > capability for microsecond timestamp granularity (e.g.,
> > 20010511.14:23:49.325) in tprintf_timestamp() was removed in favor of a
> > coarser 1-second resolution using time_t in print_timestamp()? Is that
> > correct? If not, what am I missing?
>
> > If so, is anyone aware of an existing patch to give sub-second log
> > timestamp capability? Microsecond granularity has been very helpful for
> > query timing.
>
> I can't see any good reason that print_timestamp() shouldn't use
> gettimeofday() rather than time(); certainly there's no portability
> argument for it, because we use gettimeofday in several other places.
>
> Feel free to submit a patch...

The attached patch restores pre-7.1 millisecond-granularity log
timestamps (except that it also adds a 4-digit year, which was not in
pre-7.1). It is meant to be applied to
postgresql-7.1/src/backend/utils/error/elog.c.

Regards,
Ed Loehr

Attachment Content-Type Size
elog.c.patch-7.1 text/plain 1.6 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric G. Miller 2001-05-13 05:56:51 Re: Bug with timestamp !!!
Previous Message Tom Lane 2001-05-13 05:34:51 Re: Re: Bug with timestamp !!!

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2001-05-13 10:17:38 Re: [PATCHES] Re: microsecond log timestamps
Previous Message Peter Eisentraut 2001-05-12 20:25:52 Re: Changes needed to build on NetBSD