postgresql/src/include/parser/parse_coerce.h

56 lines
1.5 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* parse_coerce.h
*
* Routines for type coercion.
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_coerce.h,v 1.42 2002/04/11 20:00:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PARSE_COERCE_H
#define PARSE_COERCE_H
#include "catalog/pg_type.h"
1999-07-16 13:07:40 -04:00
#include "parser/parse_node.h"
typedef enum CATEGORY
{
INVALID_TYPE,
UNKNOWN_TYPE,
BOOLEAN_TYPE,
STRING_TYPE,
BITSTRING_TYPE,
NUMERIC_TYPE,
DATETIME_TYPE,
TIMESPAN_TYPE,
GEOMETRIC_TYPE,
NETWORK_TYPE,
USER_TYPE,
MIXED_TYPE
1999-05-25 18:43:53 -04:00
} CATEGORY;
2002-03-20 14:45:13 -05:00
extern bool IsBinaryCompatible(Oid type1, Oid type2);
extern bool IsPreferredType(CATEGORY category, Oid type);
extern CATEGORY TypeCategory(Oid type);
extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids,
bool isExplicit);
1999-05-22 00:12:29 -04:00
extern Node *coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
Oid targetTypeId, int32 atttypmod, bool isExplicit);
extern Node *coerce_type_typmod(ParseState *pstate, Node *node,
Oid targetTypeId, int32 atttypmod);
extern bool coerce_to_boolean(ParseState *pstate, Node **pnode);
2001-03-21 23:01:46 -05:00
extern Oid select_common_type(List *typeids, const char *context);
extern Node *coerce_to_common_type(ParseState *pstate, Node *node,
2001-03-21 23:01:46 -05:00
Oid targetTypeId,
const char *context);
#endif /* PARSE_COERCE_H */