summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/timestamp.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-07-05 23:12:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-07-05 23:12:09 +0000
commit40f64064ff56c3118d156ba83df72b1779415a8a (patch)
treed318bf6c8e6e85a15d2cd6e997ee02bf233dd181 /src/backend/utils/adt/timestamp.c
parent282713a836d5dfe3dcefeaa6a6cedf5f000bdb09 (diff)
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.
Diffstat (limited to 'src/backend/utils/adt/timestamp.c')
-rw-r--r--src/backend/utils/adt/timestamp.c33
1 files changed, 24 insertions, 9 deletions
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++)