From: Daniel Wickstrom <danw@rtp.ericsson.se>
To: pgsql-sql@postgresql.org
Subject: Re: now() with microsecond granulity needed
Date: Wed, 21 Feb 2001 15:57:22 -0500 (EST)
Message-ID: <14996.11186.111947.408165@gargle.gargle.HOWL> (raw)
In-Reply-To: <20010221215416.C1718@blue.alter.pl>
References: <20010220173146.E1718@blue.alter.pl>
<12975.982688262@sss.pgh.pa.us>
<20010221215416.C1718@blue.alter.pl>
>>>>> "Radoslaw" == Radoslaw Stachowiak <radek@alter.pl> writes:
Radoslaw> *** Tom Lane <tgl@sss.pgh.pa.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=#
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: danw@rtp.ericsson.se
Subject: Re: now() with microsecond granulity needed
In-Reply-To: <14996.11186.111947.408165@gargle.gargle.HOWL>
References: <20010220173146.E1718@blue.alter.pl> <12975.982688262@sss.pgh.pa.us> <20010221215416.C1718@blue.alter.pl> <14996.11186.111947.408165@gargle.gargle.HOWL>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox