From: | Daniel Wickstrom <danw(at)rtp(dot)ericsson(dot)se> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: now() with microsecond granulity needed |
Date: | 2001-02-21 20:57:22 |
Message-ID: | 14996.11186.111947.408165@gargle.gargle.HOWL |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
>>>>> "Radoslaw" == Radoslaw Stachowiak <radek(at)alter(dot)pl> writes:
Radoslaw> *** Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [Tuesday,
Radoslaw> 20.February.2001, 11:57 -0500]:
>> > 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...
Radoslaw> Do You mean changing sources and recompiling? So there
Radoslaw> is no way of getting more accurate NOW time directly in
Radoslaw> SQL ? /DEFAULT clause/ at this moment?
the timeofday function seems to work:
acspg=# select timeofday();
timeofday
-------------------------------------
Wed Feb 21 15:56:43.150389 2001 EST
(1 row)
acspg=#
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-02-21 21:04:41 | Re: pl/Perl |
Previous Message | Radoslaw Stachowiak | 2001-02-21 20:54:16 | Re: now() with microsecond granulity needed |