Re: empty view, replace view, column type change? - Mailing list pgsql-sql

From Tom Lane
Subject Re: empty view, replace view, column type change?
Date
Msg-id 28944.1119623554@sss.pgh.pa.us
Whole thread Raw
In response to Re: empty view, replace view, column type change?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-sql
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> but it doesn't seem to me to follow from what the spec says that we need
>> to explicitly cast the result of now() to six places.  As long as it's
>> coming from gettimeofday it can't have more than 6 places anyway, and so
>> we might as well save the extra coercion step.  (The parser *will* tack
>> on a separate coercion function call when presented with this parse
>> tree.)
>> 
>> In short, I'm inclined to remove the above-quoted lines, and similarly
>> for CURRENT_TIME, CURRENT_TIMESTAMP, and LOCALTIME.  Thoughts?

> Agreed.  That "6" bothered me too when I was cleaning up the timestamp
> code a while back.

Done.  On re-reading the spec, I see that the default of six places is
intended to apply to ALL occurrences of timestamp --- that is, they
intendCREATE TABLE foo (ts timestamp);
to meanCREATE TABLE foo (ts timestamp(6));

We have deliberately decided not to do that, on a fairly consistent
basis --- numeric and varchar don't have any fixed precision limit
either if you don't specify.  So these functions were out of step
with the rest of the system, and removing their explicit precision
limit is indeed a sane way of improving consistency.
        regards, tom lane


pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: empty view, replace view, column type change?
Next
From: KÖPFERL Robert
Date:
Subject: Converting TBL->View complaining about indexes