Re: now() with microsecond granulity needed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Radoslaw Stachowiak <radek(at)alter(dot)pl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: now() with microsecond granulity needed
Date: 2001-02-20 16:57:42
Message-ID: 12975.982688262@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Radoslaw Stachowiak <radek(at)alter(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-02-20 17:36:52 Re: Huh? Mysterious Function Error
Previous Message Josh Berkus 2001-02-20 16:54:54 Huh? Mysterious Function Error