aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/typecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/typecmds.c')
-rw-r--r--src/backend/commands/typecmds.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index 982588e04a6..d67ae2c2db8 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.114 2008/03/19 18:38:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.115 2008/03/25 22:42:43 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -697,13 +697,13 @@ DefineDomain(CreateDomainStmt *stmt)
datum = SysCacheGetAttr(TYPEOID, typeTup,
Anum_pg_type_typdefault, &isnull);
if (!isnull)
- defaultValue = DatumGetCString(DirectFunctionCall1(textout, datum));
+ defaultValue = TextDatumGetCString(datum);
/* Inherited default binary value */
datum = SysCacheGetAttr(TYPEOID, typeTup,
Anum_pg_type_typdefaultbin, &isnull);
if (!isnull)
- defaultValueBin = DatumGetCString(DirectFunctionCall1(textout, datum));
+ defaultValueBin = TextDatumGetCString(datum);
/*
* Run through constraints manually to avoid the additional processing
@@ -1497,12 +1497,10 @@ AlterDomainDefault(List *names, Node *defaultRaw)
/*
* Form an updated tuple with the new default and write it back.
*/
- new_record[Anum_pg_type_typdefaultbin - 1] = DirectFunctionCall1(textin,
- CStringGetDatum(nodeToString(defaultExpr)));
+ new_record[Anum_pg_type_typdefaultbin - 1] = CStringGetTextDatum(nodeToString(defaultExpr));
new_record_repl[Anum_pg_type_typdefaultbin - 1] = 'r';
- new_record[Anum_pg_type_typdefault - 1] = DirectFunctionCall1(textin,
- CStringGetDatum(defaultValue));
+ new_record[Anum_pg_type_typdefault - 1] = CStringGetTextDatum(defaultValue);
new_record_repl[Anum_pg_type_typdefault - 1] = 'r';
}
}
@@ -2292,9 +2290,7 @@ GetDomainConstraints(Oid typeOid)
elog(ERROR, "domain \"%s\" constraint \"%s\" has NULL conbin",
NameStr(typTup->typname), NameStr(c->conname));
- check_expr = (Expr *)
- stringToNode(DatumGetCString(DirectFunctionCall1(textout,
- val)));
+ check_expr = (Expr *) stringToNode(TextDatumGetCString(val));
/* ExecInitExpr assumes we already fixed opfuncids */
fix_opfuncids((Node *) check_expr);