1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2006-04-04 19:35:37 +00:00
parent eaef111396
commit 147d4bf3e5
23 changed files with 608 additions and 402 deletions

View File

@ -2,7 +2,7 @@
* ruleutils.c - Functions to convert stored expressions/querytrees
* back to source text
*
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.217 2006/03/16 00:31:55 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.218 2006/04/04 19:35:36 tgl Exp $
**********************************************************************/
#include "postgres.h"
@ -3921,8 +3921,7 @@ get_const_expr(Const *constval, deparse_context *context)
getTypeOutputInfo(constval->consttype,
&typoutput, &typIsVarlena);
extval = DatumGetCString(OidFunctionCall1(typoutput,
constval->constvalue));
extval = OidOutputFunctionCall(typoutput, constval->constvalue);
switch (constval->consttype)
{