Need Oracle 9 tester. was Re: current_timestamp after queries

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Need Oracle 9 tester. was Re: current_timestamp after queries
Дата
Msg-id 200209301534.g8UFYvF19042@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: current_timestamp after queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: current_timestamp after queries
Следующее
От: "Andy Kriger"
Дата:
Сообщение: how do i find out how long a query took?