Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6B74F475C26 for ; Tue, 24 Sep 2002 05:35:38 -0400 (EDT) Received: from email03.aon.at (WARSL402PIP6.highway.telekom.at [195.3.96.93]) by postgresql.org (Postfix) with SMTP id 65453475BA1 for ; Tue, 24 Sep 2002 05:35:37 -0400 (EDT) Received: (qmail 30984 invoked from network); 24 Sep 2002 09:35:38 -0000 Received: from m164p016.dipool.highway.telekom.at (HELO cantor) ([62.46.10.112]) (envelope-sender ) by qmail3rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 24 Sep 2002 09:35:38 -0000 From: Manfred Koizar To: Tom Lane Cc: Bruce Momjian , josh@agliodbs.com, Aaron Held , Roberto Mello , Neil Conway , pgsql-sql@postgresql.org Subject: Re: [GENERAL] CURRENT_TIMESTAMP Date: Tue, 24 Sep 2002 11:37:30 +0200 Message-ID: References: <200209232041.g8NKfix19001@candle.pha.pa.us> <4619.1032814548@sss.pgh.pa.us> In-Reply-To: <4619.1032814548@sss.pgh.pa.us> X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/296 X-Sequence-Number: 9573 On Mon, 23 Sep 2002 16:55:48 -0400, Tom Lane wrote: >Bruce Momjian writes: >Here's an example: > >CREATE RULE foo AS ON INSERT TO mytable DO >( INSERT INTO log1 VALUES (... , now(), ...); > INSERT INTO log2 VALUES (... , now(), ...) ); > >I think it's important that these commands store the same timestamp in >both log tables (not to mention that any now() being stored into mytable >itself generate that same timestamp). I agree. SQL99 mentions this requirement for triggers and I think we can apply it to rules as well. Here is another example: BEGIN; INSERT INTO foo VALUES (..., CURRENT_TIMESTAMP, ...); -- wait a few seconds INSERT INTO foo VALUES (..., CURRENT_TIMESTAMP, ...); COMMIT; Please don't ask me, why I would want that, but the standard demands the timestamps to be different. >After all, it's only a minor implementation >detail that you chose to fire these logging operations via a rule and >not by client-side logic. No, it's fundamentally different whether you do something in one SQL-statment or per a sequence of statements. Servus Manfred