aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/formatting.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-07-29 03:26:51 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-07-29 03:26:51 +0000
commit1ebe1da296419b07377058ffad0e75bb330de8d1 (patch)
tree1f67ea127b88b997c82e9e57ad139bece91c806c /src/backend/utils/adt/formatting.c
parent20f6a1e56268f490ac2ac436e199e411de430f51 (diff)
downloadpostgresql-1ebe1da296419b07377058ffad0e75bb330de8d1.tar.gz
postgresql-1ebe1da296419b07377058ffad0e75bb330de8d1.zip
bpchar, varchar, bytea, numeric are toastable --- if you initdb, which
I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r--src/backend/utils/adt/formatting.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 3df0fe35579..864c3867ba5 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.19 2000/07/05 23:11:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.20 2000/07/29 03:26:41 tgl Exp $
*
*
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
@@ -4066,7 +4066,9 @@ numeric_to_char(PG_FUNCTION_ARGS)
x = DatumGetNumeric(DirectFunctionCall2(numeric_round,
NumericGetDatum(value),
Int32GetDatum(0)));
- numstr = orgnum = int_to_roman(numeric_int4(x));
+ numstr = orgnum =
+ int_to_roman(DatumGetInt32(DirectFunctionCall1(numeric_int4,
+ NumericGetDatum(x))));
pfree(x);
}
else
@@ -4080,8 +4082,12 @@ numeric_to_char(PG_FUNCTION_ARGS)
Numeric b = DatumGetNumeric(DirectFunctionCall1(int4_numeric,
Int32GetDatum(Num.multi)));
- x = numeric_power(a, b);
- val = numeric_mul(value, x);
+ x = DatumGetNumeric(DirectFunctionCall2(numeric_power,
+ NumericGetDatum(a),
+ NumericGetDatum(b)));
+ val = DatumGetNumeric(DirectFunctionCall2(numeric_mul,
+ NumericGetDatum(value),
+ NumericGetDatum(x)));
pfree(x);
pfree(a);
pfree(b);