Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> writes:
>> AFAIK hardly anyone actually uses CURRENT, and I've been thinking of
>> proposing that we eliminate it to make the world safe for constant-
>> folding timestamp operations. (Thomas, any comments here?)
> Well, it is a feature from "the old days". Pretty neat one at that, and
> is an example of a useful feature not found in other DBs or in
> standards, but which might show up someday because they are useful.
I'm not convinced that it is useful. What I think it is is a good way
of shooting yourself in the foot, because it's so hard to control when
'CURRENT' will be reduced to a specific time value.
I have no problem with the datetime input converters accepting the input
string 'CURRENT' and immediately replacing it with the current time.
That behavior is clearly useful and creates no semantic issues. But
I don't think that a special data value that symbolically represents
current time is either useful or well-defined.
Just to give one example of why the concept is broken: consider an index
on a timestamp column that contains some CURRENT values. Today the
index might look like
which is fine. But twenty-four hours from now, this index will be out
of order and hence broken. (The btree routines do not cope at all
gracefully with logically-inconsistent indexes.)
So I still recommend that we remove the special value CURRENT. Then we
can mark the datetime-related operators constant-foldable, which will
eliminate a complaint that we can otherwise expect to hear constantly
(saw another instance today in pgsql-sql).
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Oleg Bartunov||Date: 2000-09-17 18:56:09|
|Subject: Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ? |
|Previous:||From: Tom Lane||Date: 2000-09-17 18:18:54|
|Subject: Re: ascii to character conversion in postgres |