aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/print.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-04-04 19:35:37 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-04-04 19:35:37 +0000
commit147d4bf3e5e3da2ee0f0cc132718ab1c4912a877 (patch)
treee02e6a191197edb5224ab5f831146854fde7d460 /src/backend/nodes/print.c
parenteaef111396ef7e70c88979c7a82f6a8f918d9651 (diff)
downloadpostgresql-147d4bf3e5e3da2ee0f0cc132718ab1c4912a877.tar.gz
postgresql-147d4bf3e5e3da2ee0f0cc132718ab1c4912a877.zip
Modify all callers of datatype input and receive functions so that if these
functions are not strict, they will be called (passing a NULL first parameter) during any attempt to input a NULL value of their datatype. Currently, all our input functions are strict and so this commit does not change any behavior. However, this will make it possible to build domain input functions that centralize checking of domain constraints, thereby closing numerous holes in our domain support, as per previous discussion. While at it, I took the opportunity to introduce convenience functions InputFunctionCall, OutputFunctionCall, etc to use in code that calls I/O functions. This eliminates a lot of grotty-looking casts, but the main motivation is to make it easier to grep for these places if we ever need to touch them again.
Diffstat (limited to 'src/backend/nodes/print.c')
-rw-r--r--src/backend/nodes/print.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
index 18b7535cd06..c3fbdf242d0 100644
--- a/src/backend/nodes/print.c
+++ b/src/backend/nodes/print.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.78 2006/03/05 15:58:28 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.79 2006/04/04 19:35:34 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -357,8 +357,7 @@ print_expr(Node *expr, List *rtable)
getTypeOutputInfo(c->consttype,
&typoutput, &typIsVarlena);
- outputstr = DatumGetCString(OidFunctionCall1(typoutput,
- c->constvalue));
+ outputstr = OidOutputFunctionCall(typoutput, c->constvalue);
printf("%s", outputstr);
pfree(outputstr);
}