[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Need Oracle 9 tester.  was Re: [GENERAL] current_timestamp after queries
From:       Bruce Momjian <pgman () candle ! pha ! pa ! us>
Date:       2002-09-30 15:34:57
[Download RAW message or body]

Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic