Received: from mail.alter.pl (blue.alter.pl [212.244.165.40]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1LKsax27353 for ; Wed, 21 Feb 2001 15:54:36 -0500 (EST) (envelope-from radek@alter.pl) Received: by mail.alter.pl (Postfix, from userid 500) id 043C45B0C6; Wed, 21 Feb 2001 21:54:16 +0100 (CET) Date: Wed, 21 Feb 2001 21:54:16 +0100 From: Radoslaw Stachowiak To: pgsql-sql@postgresql.org Subject: Re: now() with microsecond granulity needed Message-ID: <20010221215416.C1718@blue.alter.pl> Mail-Followup-To: pgsql-sql@postgresql.org References: <20010220173146.E1718@blue.alter.pl> <12975.982688262@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12975.982688262@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Tue, Feb 20, 2001 at 11:57:42AM -0500 X-Archive-Number: 200102/327 X-Sequence-Number: 1523 *** Tom Lane [Tuesday, 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... Do You mean changing sources and recompiling? So there is no way of getting more accurate NOW time directly in SQL ? /DEFAULT clause/ at this moment? I just have now about 5..10 inserts per second, so in fact even ms would help me. -- radoslaw.stachowiak.........................................http://alter.pl/