Re: [SQL] [GENERAL] CURRENT_TIMESTAMP - Mailing list pgsql-hackers

From Oliver Elphick
Subject Re: [SQL] [GENERAL] CURRENT_TIMESTAMP
Date
Msg-id 1033707793.722.963.camel@linda
Whole thread Raw
In response to Re: [SQL] [GENERAL] CURRENT_TIMESTAMP  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [SQL] [GENERAL] CURRENT_TIMESTAMP  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 2002-10-04 at 01:41, Bruce Momjian wrote:
> Well, let's see what others say.  If no one is excited about the change,
> we can just document its current behavior.  Oh, I see it is already
> documented in func.sgml:
> 
>     It is quite important to realize that
>     <function>CURRENT_TIMESTAMP</function> and related functions all return
>     the time as of the start of the current transaction; their values do not
>     increment while a transaction is running.  But
>     <function>timeofday()</function> returns the actual current time.
> 
> Seems that isn't helping enough to reduce the number of people who are
> surprised by our behavior.  I don't think anyone would be surprised by
> statement time.
> 
> What do others think?

I would prefer that CURRENT_TIME[STAMP] always produce the same time
within a transaction.  If it is changed, it will certainly break one of
my applications, which explicitly depends on the current behaviour.  If
you change it, please provide an alternative way of doing the same
thing.

I can see that the current behaviour might give surprising results in a
long running transaction.  Surprise could be reduced by giving the time
of first use within the transaction rather than the start of the
transaction.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                            
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "For the word of God is quick, and powerful, and       sharper than any
twoedgedsword, piercing even to the      dividing asunder of soul and spirit, and of the joints     and marrow, and is
adiscerner of the thoughts and      intents of the heart."        Hebrews 4:12 
 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Return of INSTEAD rules
Next
From: Tom Lane
Date:
Subject: Re: [SQL] [GENERAL] CURRENT_TIMESTAMP