From 40f64064ff56c3118d156ba83df72b1779415a8a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 5 Jul 2000 23:12:09 +0000 Subject: Update textin() and textout() to new fmgr style. This is just phase one of updating the whole text datatype, but there are so dang many calls of these two routines that it seems worth a separate commit. --- src/backend/utils/adt/timestamp.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'src/backend/utils/adt/timestamp.c') diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 4b3f498a2af..d5d5b86f9fe 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.31 2000/07/03 23:09:53 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.32 2000/07/05 23:11:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1487,7 +1487,9 @@ timestamp_trunc(PG_FUNCTION_ARGS) *tm = &tt; if (VARSIZE(units) - VARHDRSZ > MAXDATELEN) - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) @@ -1625,7 +1627,9 @@ interval_trunc(PG_FUNCTION_ARGS) result = (Interval *) palloc(sizeof(Interval)); if (VARSIZE(units) - VARHDRSZ > MAXDATELEN) - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) @@ -1706,7 +1710,9 @@ interval_trunc(PG_FUNCTION_ARGS) #endif else { - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); PG_RETURN_NULL(); } @@ -1738,7 +1744,9 @@ timestamp_part(PG_FUNCTION_ARGS) *tm = &tt; if (VARSIZE(units) - VARHDRSZ > MAXDATELEN) - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) @@ -1926,7 +1934,9 @@ interval_part(PG_FUNCTION_ARGS) *tm = &tt; if (VARSIZE(units) - VARHDRSZ > MAXDATELEN) - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) @@ -2000,7 +2010,8 @@ interval_part(PG_FUNCTION_ARGS) default: elog(ERROR, "Interval units '%s' not yet supported", - textout(units)); + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); result = 0; } @@ -2022,7 +2033,9 @@ interval_part(PG_FUNCTION_ARGS) } else { - elog(ERROR, "Interval units '%s' not recognized", textout(units)); + elog(ERROR, "Interval units '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(units)))); result = 0; } @@ -2056,7 +2069,9 @@ timestamp_zone(PG_FUNCTION_ARGS) int len; if (VARSIZE(zone) - VARHDRSZ > MAXDATELEN) - elog(ERROR, "Time zone '%s' not recognized", textout(zone)); + elog(ERROR, "Time zone '%s' not recognized", + DatumGetCString(DirectFunctionCall1(textout, + PointerGetDatum(zone)))); up = VARDATA(zone); lp = lowzone; for (i = 0; i < (VARSIZE(zone) - VARHDRSZ); i++) -- cgit v1.2.3