88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.131 2005/07/1215:17:44 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.132 2005/07/1216:04:58 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -47,7 +47,6 @@ TimestampTz PgStartTime;
4747
4848#ifdef HAVE_INT64_TIMESTAMP
4949static int64 time2t (const int hour ,const int min ,const int sec ,const fsec_t fsec );
50-
5150#else
5251static double time2t (const int hour ,const int min ,const int sec ,const fsec_t fsec );
5352#endif
@@ -642,7 +641,10 @@ interval_scale(PG_FUNCTION_ARGS)
642641
643642PG_RETURN_INTERVAL_P (result );
644643}
645-
644+ /*
645+ *Adjust interval for specified precision, in both YEAR to SECOND
646+ *range and sub-second precision.
647+ */
646648static void
647649AdjustIntervalForTypmod (Interval * interval ,int32 typmod )
648650{
@@ -722,7 +724,6 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
722724{
723725#ifdef HAVE_INT64_TIMESTAMP
724726int64 day ;
725-
726727#else
727728double day ;
728729#endif
@@ -744,7 +745,6 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
744745{
745746#ifdef HAVE_INT64_TIMESTAMP
746747int64 hour ;
747-
748748#else
749749double hour ;
750750#endif
@@ -887,7 +887,7 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
887887else
888888elog (ERROR ,"unrecognized interval typmod: %d" ,typmod );
889889
890- /* Need to adjust precision? If not, don't even try! */
890+ /* Need to adjustsubsecond precision? */
891891if (precision != INTERVAL_FULL_PRECISION )
892892{
893893if (precision < 0 || precision > MAX_INTERVAL_PRECISION )
@@ -990,7 +990,6 @@ dt2time(Timestamp jd, int *hour, int *min, int *sec, fsec_t *fsec)
990990{
991991#ifdef HAVE_INT64_TIMESTAMP
992992int64 time ;
993-
994993#else
995994double time ;
996995#endif
@@ -1171,7 +1170,6 @@ tm2timestamp(struct pg_tm * tm, fsec_t fsec, int *tzp, Timestamp *result)
11711170#ifdef HAVE_INT64_TIMESTAMP
11721171int date ;
11731172int64 time ;
1174-
11751173#else
11761174double date ,
11771175time ;
@@ -1211,7 +1209,6 @@ interval2tm(Interval span, struct pg_tm * tm, fsec_t *fsec)
12111209{
12121210#ifdef HAVE_INT64_TIMESTAMP
12131211int64 time ;
1214-
12151212#else
12161213double time ;
12171214#endif
@@ -1648,7 +1645,6 @@ interval_cmp_internal(Interval *interval1, Interval *interval2)
16481645#ifdef HAVE_INT64_TIMESTAMP
16491646int64 span1 ,
16501647span2 ;
1651-
16521648#else
16531649double span1 ,
16541650span2 ;
@@ -2192,7 +2188,6 @@ interval_mul(PG_FUNCTION_ARGS)
21922188
21932189#ifdef HAVE_INT64_TIMESTAMP
21942190int64 months ;
2195-
21962191#else
21972192double months ;
21982193#endif