Re: microsecond log timestamps - Mailing list pgsql-general

From Tom Lane
Subject Re: microsecond log timestamps
Date
Msg-id 10377.989690744@sss.pgh.pa.us
Whole thread Raw
In response to microsecond log timestamps  (Ed Loehr <eloehr@austin.rr.com>)
List pgsql-general
Ed Loehr <eloehr@austin.rr.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...

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: about new join syntax performance
Next
From: Tom Lane
Date:
Subject: Re: COPY locking