Re: now() with microsecond granulity needed - Mailing list pgsql-sql

From Tom Lane
Subject Re: now() with microsecond granulity needed
Date
Msg-id 12975.982688262@sss.pgh.pa.us
Whole thread Raw
In response to now() with microsecond granulity needed  (Radoslaw Stachowiak <radek@alter.pl>)
Responses Re: now() with microsecond granulity needed  (Radoslaw Stachowiak <radek@alter.pl>)
List pgsql-sql
Radoslaw Stachowiak <radek@alter.pl> writes:
> using now() to init TIMESTAMP fields I got resolution of one second. How
> can I define DEFAULT in column (TIMESTAMP type) to get higher
> time-resolution (TIMESTAMP supports microseconds).

You could make a variant of now() that relies on gettimeofday() instead
of time().  Note that you probably won't get microsecond precision in
any case...
        regards, tom lane


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Huh? Mysterious Function Error
Next
From: Tom Lane
Date:
Subject: Re: Huh? Mysterious Function Error