- {
- /*
- * We assume here that UNKNOWN's internal representation is the
- * same as CSTRING
- */
- char *val = DatumGetCString(con->constvalue);
-
- /*
- * We pass typmod -1 to the input routine, primarily because
- * existing input routines follow implicit-coercion semantics for
- * length checks, which is not always what we want here. Any
- * length constraint will be applied later by our caller.
- *
- * Note that we call stringTypeDatum using the domain's pg_type
- * row, if it's a domain. This works because the domain row has
- * the same typinput and typelem as the base type --- ugly...
- */
- newcon->constvalue = stringTypeDatum(targetType, val, -1);
- }
+ newcon->constvalue = stringTypeDatum(targetType,
+ DatumGetCString(con->constvalue),
+ -1);
+ else
+ newcon->constvalue = stringTypeDatum(targetType, NULL, -1);