Received: from imr1.ericy.com (imr1.ericy.com [208.237.135.240]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1LKw1x27811 for ; Wed, 21 Feb 2001 15:58:02 -0500 (EST) (envelope-from danw@netmanager7.rtp.ericsson.se) Received: from mr3.exu.ericsson.se (mr3u3.ericy.com [208.237.135.126]) by imr1.ericy.com (8.10.2/8.10.2) with ESMTP id f1LKvxr03513 for ; Wed, 21 Feb 2001 14:57:59 -0600 (CST) Received: from eamrcnt749 (eamrcnt749.exu.ericsson.se [138.85.133.47]) by mr3.exu.ericsson.se (8.10.2/8.10.2) with SMTP id f1LKvwm29241 for ; Wed, 21 Feb 2001 14:57:58 -0600 (CST) Received: FROM netmanager7.rtp.ericsson.se BY eamrcnt749 ; Wed Feb 21 14:59:18 2001 -0600 Received: from satdsp14.ericsson.COM (satdsp14.rtp.ericsson.se [147.117.84.7]) by netmanager7.rtp.ericsson.se (8.8.8+Sun/8.6.4) with ESMTP id PAA01060 for ; Wed, 21 Feb 2001 15:57:54 -0500 (EST) Received: (from danw@localhost) by satdsp14.ericsson.COM (8.9.1b+Sun/8.9.1) id PAA28257; Wed, 21 Feb 2001 15:57:53 -0500 (EST) From: Daniel Wickstrom MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14996.11186.111947.408165@gargle.gargle.HOWL> Date: Wed, 21 Feb 2001 15:57:22 -0500 (EST) To: pgsql-sql@postgresql.org Subject: Re: now() with microsecond granulity needed 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> X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-Archive-Number: 200102/328 X-Sequence-Number: 1524 >>>>> "Radoslaw" == Radoslaw Stachowiak writes: Radoslaw> *** Tom Lane [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=#