Re: [GENERAL] CURRENT_TIMESTAMP

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: josh(at)agliodbs(dot)com, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Aaron Held <aaron(at)MetroNY(dot)com>, Roberto Mello <rmello(at)cc(dot)usu(dot)edu>, Neil Conway <neilc(at)samurai(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: [GENERAL] CURRENT_TIMESTAMP
Date: 2002-09-24 13:26:25
Message-ID: 12393.1032873985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> On Mon, 23 Sep 2002 13:36:59 -0700, Josh Berkus <josh(at)agliodbs(dot)com>
> wrote:
>> Ideally, since we get this question a lot, that a compile-time or
>> execution-time switch to change the behavior of current_timestamp
>> contextually would be nice.

> Yes, GUC!

I think a GUC variable is overkill, in fact potentially dangerous
(what if it's been changed without your app noticing)? I'm fine with
changing current_timestamp to be start-of-current-interactive-command,
though I'd not want to try to chop it more finely than that, for the
reasons already discussed. But I strongly feel that we should leave
the historical behavior of now() alone. There is no spec-based argument
for changing now(), since it isn't in the spec, and its behavior has
been set *and documented* in Postgres since Berkeley days.

If we leave now() alone then there's no need to create another
non-spec-compliant syntax like 'transaction_timestamp', either.
(I really don't want to see us do that, because without parens
it would mean making a new, not-in-the-spec fully-reserved word.)

BTW, as long as we are dorking with the current-time family, does
anyone want to vote for changing timeofday() to return a timestamptz
instead of a text string? There's no good argument except slavish
backward compatibility for having it return text, and we seem to be
quite willing to ignore backwards compatibility in this thread ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yury Bokhoncovich 2002-09-24 13:48:35 Re: rotatelog / logrotate with PostgreSQL
Previous Message snpe 2002-09-24 13:04:38 Re: query for non-unique values?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-09-24 13:31:22 Re: Problem on PG7.2.2
Previous Message CoL 2002-09-24 12:23:21 Re: Web site

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2002-09-24 13:51:09 Re: arrays (was untitled)
Previous Message Christoph Haller 2002-09-24 12:08:29 Re: [GENERAL] CURRENT_TIMESTAMP