aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-10-04 14:49:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-10-04 14:49:57 +0000
commit64dff0beac3c76dd7035bfaa2e4357aa4798cc96 (patch)
tree5c923480ef85622a9af7d83c4e55ee607d751db7 /src
parentc4566933b10cd77943ed70aab77d19e9b00df2a6 (diff)
downloadpostgresql-64dff0beac3c76dd7035bfaa2e4357aa4798cc96.tar.gz
postgresql-64dff0beac3c76dd7035bfaa2e4357aa4798cc96.zip
Fix some problems in new variable-resolution-timestamp code.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/date.c14
-rw-r--r--src/backend/utils/adt/timestamp.c19
2 files changed, 22 insertions, 11 deletions
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index d35849cd62a..762f6e0fbeb 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.59 2001/10/03 05:29:24 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.60 2001/10/04 14:49:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -920,8 +920,10 @@ text_time(PG_FUNCTION_ARGS)
*dp++ = *sp++;
*dp = '\0';
- return DirectFunctionCall1(time_in,
- CStringGetDatum(dstr));
+ return DirectFunctionCall3(time_in,
+ CStringGetDatum(dstr),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
}
@@ -1448,8 +1450,10 @@ text_timetz(PG_FUNCTION_ARGS)
*dp++ = *sp++;
*dp = '\0';
- return DirectFunctionCall1(timetz_in,
- CStringGetDatum(dstr));
+ return DirectFunctionCall3(timetz_in,
+ CStringGetDatum(dstr),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
}
/* timetz_zone()
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 112e8a26d6f..fbd85df787c 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.53 2001/10/03 15:50:48 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.54 2001/10/04 14:49:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -152,7 +152,10 @@ AdjustTimestampForTypmod(Timestamp *time, int32 typmod)
static int32 TimestampTypmod = 0;
if (typmod != TimestampTypmod)
- TimestampScale = pow(10, typmod);
+ {
+ TimestampScale = pow(10.0, typmod);
+ TimestampTypmod = typmod;
+ }
*time = (rint(((double) *time)*TimestampScale)/TimestampScale);
}
@@ -1716,8 +1719,10 @@ text_timestamp(PG_FUNCTION_ARGS)
*dp++ = *sp++;
*dp = '\0';
- return DirectFunctionCall1(timestamp_in,
- CStringGetDatum(dstr));
+ return DirectFunctionCall3(timestamp_in,
+ CStringGetDatum(dstr),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
}
@@ -1770,8 +1775,10 @@ text_timestamptz(PG_FUNCTION_ARGS)
*dp++ = *sp++;
*dp = '\0';
- return DirectFunctionCall1(timestamptz_in,
- CStringGetDatum(dstr));
+ return DirectFunctionCall3(timestamptz_in,
+ CStringGetDatum(dstr),
+ ObjectIdGetDatum(InvalidOid),
+ Int32GetDatum(-1));
}