diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-05 23:12:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-05 23:12:09 +0000 |
commit | 40f64064ff56c3118d156ba83df72b1779415a8a (patch) | |
tree | d318bf6c8e6e85a15d2cd6e997ee02bf233dd181 /src/backend/utils/adt/formatting.c | |
parent | 282713a836d5dfe3dcefeaa6a6cedf5f000bdb09 (diff) | |
download | postgresql-40f64064ff56c3118d156ba83df72b1779415a8a.tar.gz postgresql-40f64064ff56c3118d156ba83df72b1779415a8a.zip |
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/formatting.c')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index cf7d3618426..3df0fe35579 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.18 2000/07/03 23:09:50 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.19 2000/07/05 23:11:35 tgl Exp $ * * * Portions Copyright (c) 1999-2000, PostgreSQL, Inc @@ -2420,8 +2420,8 @@ timestamp_to_char(PG_FUNCTION_ARGS) len = VARSIZE(fmt) - VARHDRSZ; - if ((!len) || (TIMESTAMP_NOT_FINITE(dt))) - return PointerGetDatum(textin("")); + if (len <= 0 || TIMESTAMP_NOT_FINITE(dt)) + return DirectFunctionCall1(textin, CStringGetDatum("")); ZERO_tm(tm); tzn = NULL; @@ -3956,13 +3956,11 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, char *number, #define NUM_TOCHAR_prepare \ do { \ len = VARSIZE(fmt) - VARHDRSZ; \ - \ if (len <= 0) \ - return PointerGetDatum(textin("")); \ - \ + return DirectFunctionCall1(textin, CStringGetDatum("")); \ result = (text *) palloc( (len * NUM_MAX_ITEM_SIZ) + 1 + VARHDRSZ); \ format = NUM_cache(len, &Num, VARDATA(fmt), &flag); \ -} while(0) +} while (0) /* ---------- * MACRO: Finish part of NUM |