Search Postgresql Archives

Re: timestamp default values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brendan Jurd <direvus@xxxxxxxxx> writes:
> Does anybody know why this function returns text?  The documentation
> cites "historical reasons".  Are any of those historical reasons still
> relevant?

Backwards compatibility --- changing the result datatype would
surely break some applications.  I'm a tad worried even about changing
the output format, but we can probably get away with that, especially
if we do it as part of a new release.  (Back-patching such a change
seems like a no-no.)

There has been some talk of bypassing this problem by inventing a whole
new function with a different name, but no one's put up a proposal that
garnered enough support.  (I seem to recall a tentative consensus on
inventing a single function that would take an argument to say whether
you wanted transaction start time, statement start time, or true current
time --- but that fell apart when it was pointed out that we would have
to label such a function volatile, thereby making it unindexable.  We
really need to use differently-named functions for these things.)

> Or perhaps I could add an optional precision parameter to timenow(),
> so you could call timenow(6) and achieve the same thing.

I'd be interested to see how you do that, considering that abstime
can't store fractional seconds.  timenow() is even more obsolete than
timeofday() --- AFAICS it's not documented at all, anywhere.  The whole
abstime datatype is obsolete, actually, and will have to go away
sometime before 2038.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux