Re: Changing behavior of BEGIN...sleep...do something...COMMIT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Changing behavior of BEGIN...sleep...do something...COMMIT
Date
Msg-id 806.1048977918@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing behavior of BEGIN...sleep...do something...COMMIT  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Changing behavior of BEGIN...sleep...do something...COMMIT  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Alvaro Herrera wrote:
>> While at this, what do you think about adding the necessary variables
>> to make now('transaction') and now('query') possible?

> TODO already has:
>     * Add now("transaction|statement|clock") functionality

I know that's what we agreed to awhile back, but I've realized that that
would be a foolish way to do it.

The problem is that such a function would have to be marked VOLATILE,
which would prevent its use in indexscan qualifiers.  The volatility
labeling is a property of the function, not of the particular argument
it's passed, so we'd have to label it for the worst-case behavior.

Accordingly, it's a bad idea to invent now('clock') and make it the
same function as the other flavors.  We could get away with making
now('transaction') and now('statement') ---- but the argument for this
was consistency, and that argument pretty much falls flat if those two
are one function while clock time is something else.

So I'm back in the camp of thinking three separate parameterless
functions are the way to do it.  We already know what now() does,
and we're not going to change it --- anyone want to propose names
for the other two?
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: Re: updateable cursors & visibility
Next
From: Doug McNaught
Date:
Subject: Re: Changing behavior of BEGIN...sleep...do something...COMMIT