1 /*-------------------------------------------------------------------------
4 * Routines for type coercion.
7 * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $Id: parse_coerce.h,v 1.47 2002/09/18 21:35:24 tgl Exp $
12 *-------------------------------------------------------------------------
14 #ifndef PARSE_COERCE_H
15 #define PARSE_COERCE_H
17 #include "catalog/pg_type.h"
18 #include "parser/parse_node.h"
36 extern bool IsBinaryCoercible(Oid srctype, Oid targettype);
37 extern bool IsPreferredType(CATEGORY category, Oid type);
38 extern CATEGORY TypeCategory(Oid type);
40 extern Node *coerce_to_target_type(Node *expr, Oid exprtype,
41 Oid targettype, int32 targettypmod,
42 CoercionContext ccontext,
43 CoercionForm cformat);
44 extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids,
45 CoercionContext ccontext);
46 extern Node *coerce_type(Node *node, Oid inputTypeId, Oid targetTypeId,
47 CoercionContext ccontext, CoercionForm cformat);
48 extern Node *coerce_type_constraints(Node *arg, Oid typeId,
49 CoercionForm cformat);
51 extern Node *coerce_to_boolean(Node *node, const char *constructName);
53 extern Oid select_common_type(List *typeids, const char *context);
54 extern Node *coerce_to_common_type(Node *node, Oid targetTypeId,
57 extern Oid find_typmod_coercion_function(Oid typeId, int *nargs);
59 #endif /* PARSE_COERCE_H */