Need Oracle 9 tester. was Re: current_timestamp after queries

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Guido Staub <staub(at)gik(dot)uni-karlsruhe(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Need Oracle 9 tester. was Re: current_timestamp after queries
Date: 2002-09-30 15:34:57
Message-ID: 200209301534.g8UFYvF19042@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Yes, timeofday() will work, but it can change during the statement, right?
>
> For what he was doing, it seemed perfectly acceptable.
>
> This comes back to the point I've been making during the pghackers
> discussion: start-of-transaction time has clear uses, and
> exact-current-time has clear uses, but it's not nearly as obvious
> why you'd need start-of-statement time in preference to either of
> the others.

How about:

BEGIN;
LOCK tab; -- could block
INSERT INTO tab VALUES (..., CURRENT_TIMESTAMP);

If this is an order-entry application, you would want the statement
start time, not the transaction start time. However, if you were
inserting this into several tables, we would want transaction timestamp
so it is always the same.

Is someone running Oracle 9 that can test this? We need:

BEGIN;
SELECT CURRENT_TIMESTAMP;
-- wait 5 seconds
SELECT CURRENT_TIMESTAMP;

Are those two timestamps the same?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Colin Wiel 2002-09-30 15:41:20 psql scripts
Previous Message Tom Lane 2002-09-30 15:29:59 Re: current_timestamp after queries

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-09-30 15:39:28 Re: 7.2.3?
Previous Message Joe Conway 2002-09-30 15:30:48 Re: 7.2.3 fixes (was Re: Cause of missing pg_clog files)