Re: Changing behavior of BEGIN...sleep...do something...COMMIT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Changing behavior of BEGIN...sleep...do something...COMMIT
Date: 2003-03-29 22:45:18
Message-ID: 806.1048977918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2003-03-29 23:40:52 Re: Changing behavior of BEGIN...sleep...do something...COMMIT
Previous Message Hiroshi Inoue 2003-03-29 22:00:06 Re: updateable cursors & visibility