Re: Constant propagation and similar issues - Mailing list pgsql-hackers

From Ross J. Reedstrom
Subject Re: Constant propagation and similar issues
Date
Msg-id 20000911104703.E13906@rice.edu
Whole thread Raw
In response to Re: Constant propagation and similar issues  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Constant propagation and similar issues
List pgsql-hackers
On Mon, Sep 11, 2000 at 11:15:58AM -0400, Tom Lane wrote:
> 
> Most of the datetime operations are not considered constant-foldable.
> The reason is that type timestamp has a special value CURRENT that
> is a symbolic representation of current time (this is NOT what now()
> produces, but might be thought of as a data-driven way of invoking
> now()).  This value will get reduced to a simple constant when it is
> fed into an arithmetic operation.  Hence, premature evaluation changes
> the results and would not be a correct optimization.
> 
> 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?)
> 

I checked the ansi SQL'99 docs, and CURRENT as a date special constant
is not a part of the standard (although CURRENT is a keyword: it is 
used in the context of cursors)

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: problems with GRANT on Solaris 8
Next
From: Jules Bean
Date:
Subject: Re: Constant propagation and similar issues