Make parser functions static where possible.
This commit is contained in:
parent
97ad0b1cd4
commit
b704426618
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.2 1997/11/26 01:11:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.3 1997/11/26 03:42:37 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -27,6 +27,10 @@
|
||||||
#include "parser/parse_target.h"
|
#include "parser/parse_target.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
|
|
||||||
|
static bool contain_agg_clause(Node *clause);
|
||||||
|
static bool exprIsAggOrGroupCol(Node *expr, List *groupClause);
|
||||||
|
static bool tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AddAggToParseState -
|
* AddAggToParseState -
|
||||||
* add the aggregate to the list of unique aggregates in pstate.
|
* add the aggregate to the list of unique aggregates in pstate.
|
||||||
|
@ -93,7 +97,7 @@ finalizeAggregates(ParseState *pstate, Query *qry)
|
||||||
*
|
*
|
||||||
* Returns true if any aggregate found.
|
* Returns true if any aggregate found.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
contain_agg_clause(Node *clause)
|
contain_agg_clause(Node *clause)
|
||||||
{
|
{
|
||||||
if (clause == NULL)
|
if (clause == NULL)
|
||||||
|
@ -151,7 +155,7 @@ contain_agg_clause(Node *clause)
|
||||||
* exprIsAggOrGroupCol -
|
* exprIsAggOrGroupCol -
|
||||||
* returns true if the expression does not contain non-group columns.
|
* returns true if the expression does not contain non-group columns.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
exprIsAggOrGroupCol(Node *expr, List *groupClause)
|
exprIsAggOrGroupCol(Node *expr, List *groupClause)
|
||||||
{
|
{
|
||||||
List *gl;
|
List *gl;
|
||||||
|
@ -185,7 +189,7 @@ exprIsAggOrGroupCol(Node *expr, List *groupClause)
|
||||||
* tleIsAggOrGroupCol -
|
* tleIsAggOrGroupCol -
|
||||||
* returns true if the TargetEntry is Agg or GroupCol.
|
* returns true if the TargetEntry is Agg or GroupCol.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause)
|
tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause)
|
||||||
{
|
{
|
||||||
Node *expr = tle->expr;
|
Node *expr = tle->expr;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.2 1997/11/26 01:11:16 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3 1997/11/26 03:42:39 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -25,6 +25,62 @@
|
||||||
#include "parser/parse_relation.h"
|
#include "parser/parse_relation.h"
|
||||||
#include "parser/parse_target.h"
|
#include "parser/parse_target.h"
|
||||||
|
|
||||||
|
static TargetEntry *find_targetlist_entry(ParseState *pstate,
|
||||||
|
SortGroupBy *sortgroupby, List *tlist);
|
||||||
|
static void parseFromClause(ParseState *pstate, List *frmList);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* makeRangeTable -
|
||||||
|
* make a range table with the specified relation (optional) and the
|
||||||
|
* from-clause.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
makeRangeTable(ParseState *pstate, char *relname, List *frmList)
|
||||||
|
{
|
||||||
|
RangeTblEntry *rte;
|
||||||
|
|
||||||
|
parseFromClause(pstate, frmList);
|
||||||
|
|
||||||
|
if (relname == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (refnameRangeTablePosn(pstate->p_rtable, relname) < 1)
|
||||||
|
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE);
|
||||||
|
else
|
||||||
|
rte = refnameRangeTableEntry(pstate->p_rtable, relname);
|
||||||
|
|
||||||
|
pstate->p_target_rangetblentry = rte;
|
||||||
|
Assert(pstate->p_target_relation == NULL);
|
||||||
|
pstate->p_target_relation = heap_open(rte->relid);
|
||||||
|
Assert(pstate->p_target_relation != NULL);
|
||||||
|
/* will close relation later */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* transformWhereClause -
|
||||||
|
* transforms the qualification and make sure it is of type Boolean
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Node *
|
||||||
|
transformWhereClause(ParseState *pstate, Node *a_expr)
|
||||||
|
{
|
||||||
|
Node *qual;
|
||||||
|
|
||||||
|
if (a_expr == NULL)
|
||||||
|
return (Node *) NULL; /* no qualifiers */
|
||||||
|
|
||||||
|
pstate->p_in_where_clause = true;
|
||||||
|
qual = transformExpr(pstate, a_expr, EXPR_COLUMN_FIRST);
|
||||||
|
pstate->p_in_where_clause = false;
|
||||||
|
if (exprType(qual) != BOOLOID)
|
||||||
|
{
|
||||||
|
elog(WARN,
|
||||||
|
"where clause must return type bool, not %s",
|
||||||
|
typeidTypeName(exprType(qual)));
|
||||||
|
}
|
||||||
|
return qual;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parseFromClause -
|
* parseFromClause -
|
||||||
* turns the table references specified in the from-clause into a
|
* turns the table references specified in the from-clause into a
|
||||||
|
@ -34,7 +90,7 @@
|
||||||
* also allow that in our POST-SQL)
|
* also allow that in our POST-SQL)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
parseFromClause(ParseState *pstate, List *frmList)
|
parseFromClause(ParseState *pstate, List *frmList)
|
||||||
{
|
{
|
||||||
List *fl;
|
List *fl;
|
||||||
|
@ -65,77 +121,13 @@ parseFromClause(ParseState *pstate, List *frmList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* makeRangeTable -
|
|
||||||
* make a range table with the specified relation (optional) and the
|
|
||||||
* from-clause.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
makeRangeTable(ParseState *pstate, char *relname, List *frmList)
|
|
||||||
{
|
|
||||||
RangeTblEntry *rte;
|
|
||||||
|
|
||||||
parseFromClause(pstate, frmList);
|
|
||||||
|
|
||||||
if (relname == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (refnameRangeTablePosn(pstate->p_rtable, relname) < 1)
|
|
||||||
rte = addRangeTableEntry(pstate, relname, relname, FALSE, FALSE);
|
|
||||||
else
|
|
||||||
rte = refnameRangeTableEntry(pstate->p_rtable, relname);
|
|
||||||
|
|
||||||
pstate->p_target_rangetblentry = rte;
|
|
||||||
Assert(pstate->p_target_relation == NULL);
|
|
||||||
pstate->p_target_relation = heap_open(rte->relid);
|
|
||||||
Assert(pstate->p_target_relation != NULL);
|
|
||||||
/* will close relation later */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
*
|
|
||||||
* Where Clause
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* transformWhereClause -
|
|
||||||
* transforms the qualification and make sure it is of type Boolean
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Node *
|
|
||||||
transformWhereClause(ParseState *pstate, Node *a_expr)
|
|
||||||
{
|
|
||||||
Node *qual;
|
|
||||||
|
|
||||||
if (a_expr == NULL)
|
|
||||||
return (Node *) NULL; /* no qualifiers */
|
|
||||||
|
|
||||||
pstate->p_in_where_clause = true;
|
|
||||||
qual = transformExpr(pstate, a_expr, EXPR_COLUMN_FIRST);
|
|
||||||
pstate->p_in_where_clause = false;
|
|
||||||
if (exprType(qual) != BOOLOID)
|
|
||||||
{
|
|
||||||
elog(WARN,
|
|
||||||
"where clause must return type bool, not %s",
|
|
||||||
typeidTypeName(exprType(qual)));
|
|
||||||
}
|
|
||||||
return qual;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
*
|
|
||||||
* Sort Clause
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find_targetlist_entry -
|
* find_targetlist_entry -
|
||||||
* returns the Resdom in the target list matching the specified varname
|
* returns the Resdom in the target list matching the specified varname
|
||||||
* and range
|
* and range
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
TargetEntry *
|
static TargetEntry *
|
||||||
find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
|
find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
|
||||||
{
|
{
|
||||||
List *i;
|
List *i;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.2 1997/11/26 01:11:17 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.3 1997/11/26 03:42:41 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#include "nodes/params.h"
|
#include "nodes/params.h"
|
||||||
#include "nodes/relation.h"
|
#include "nodes/relation.h"
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
|
#include "parser/gramparse.h"
|
||||||
#include "parser/parse_expr.h"
|
#include "parser/parse_expr.h"
|
||||||
#include "parser/parse_func.h"
|
#include "parser/parse_func.h"
|
||||||
#include "parser/parse_node.h"
|
#include "parser/parse_node.h"
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
#include "parser/parse_target.h"
|
#include "parser/parse_target.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
|
|
||||||
Oid param_type(int t); /* from gram.y */
|
static Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* transformExpr -
|
* transformExpr -
|
||||||
|
@ -397,7 +398,7 @@ handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno)
|
||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *
|
static Node *
|
||||||
parser_typecast(Value *expr, TypeName *typename, int typlen)
|
parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||||
{
|
{
|
||||||
/* check for passing non-ints */
|
/* check for passing non-ints */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.2 1997/11/26 01:11:21 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.3 1997/11/26 03:42:42 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -42,6 +42,37 @@
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
|
|
||||||
|
static Node *ParseComplexProjection(ParseState *pstate,
|
||||||
|
char *funcname,
|
||||||
|
Node *first_arg,
|
||||||
|
bool *attisset);
|
||||||
|
static Oid ** argtype_inherit(int nargs, Oid *oid_array);
|
||||||
|
static bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
|
||||||
|
static int find_inheritors(Oid relid, Oid **supervec);
|
||||||
|
static CandidateList func_get_candidates(char *funcname, int nargs);
|
||||||
|
static bool func_get_detail(char *funcname,
|
||||||
|
int nargs,
|
||||||
|
Oid *oid_array,
|
||||||
|
Oid *funcid, /* return value */
|
||||||
|
Oid *rettype, /* return value */
|
||||||
|
bool *retset, /* return value */
|
||||||
|
Oid **true_typeids);
|
||||||
|
static Oid * func_select_candidate(int nargs,
|
||||||
|
Oid *input_typeids,
|
||||||
|
CandidateList candidates);
|
||||||
|
static Oid funcid_get_rettype(Oid funcid);
|
||||||
|
static Oid **gen_cross_product(InhPaths *arginh, int nargs);
|
||||||
|
static void make_arguments(int nargs,
|
||||||
|
List *fargs,
|
||||||
|
Oid *input_typeids,
|
||||||
|
Oid *function_typeids);
|
||||||
|
static int match_argtypes(int nargs,
|
||||||
|
Oid *input_typeids,
|
||||||
|
CandidateList function_typeids,
|
||||||
|
CandidateList *candidates);
|
||||||
|
static List *setup_tlist(char *attname, Oid relid);
|
||||||
|
static List *setup_base_tlist(Oid typeid);
|
||||||
|
|
||||||
#define ISCOMPLEX(type) (typeidTypeRelid(type) ? true : false)
|
#define ISCOMPLEX(type) (typeidTypeRelid(type) ? true : false)
|
||||||
|
|
||||||
#define MAXFARGS 8 /* max # args to a c or postquel function */
|
#define MAXFARGS 8 /* max # args to a c or postquel function */
|
||||||
|
@ -400,7 +431,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
|
||||||
return (retval);
|
return (retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
Oid
|
static Oid
|
||||||
funcid_get_rettype(Oid funcid)
|
funcid_get_rettype(Oid funcid)
|
||||||
{
|
{
|
||||||
HeapTuple func_tuple = NULL;
|
HeapTuple func_tuple = NULL;
|
||||||
|
@ -422,7 +453,7 @@ funcid_get_rettype(Oid funcid)
|
||||||
* get a list of all argument type vectors for which a function named
|
* get a list of all argument type vectors for which a function named
|
||||||
* funcname taking nargs arguments exists
|
* funcname taking nargs arguments exists
|
||||||
*/
|
*/
|
||||||
CandidateList
|
static CandidateList
|
||||||
func_get_candidates(char *funcname, int nargs)
|
func_get_candidates(char *funcname, int nargs)
|
||||||
{
|
{
|
||||||
Relation heapRelation;
|
Relation heapRelation;
|
||||||
|
@ -500,7 +531,7 @@ func_get_candidates(char *funcname, int nargs)
|
||||||
/*
|
/*
|
||||||
* can input_typeids be coerced to func_typeids?
|
* can input_typeids be coerced to func_typeids?
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
|
can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -539,7 +570,7 @@ can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
|
||||||
* that match the input typeids (either exactly or by coercion), and
|
* that match the input typeids (either exactly or by coercion), and
|
||||||
* return the number of such arrays
|
* return the number of such arrays
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
match_argtypes(int nargs,
|
match_argtypes(int nargs,
|
||||||
Oid *input_typeids,
|
Oid *input_typeids,
|
||||||
CandidateList function_typeids,
|
CandidateList function_typeids,
|
||||||
|
@ -577,7 +608,7 @@ match_argtypes(int nargs,
|
||||||
* returns the selected argtype array if the conflict can be resolved,
|
* returns the selected argtype array if the conflict can be resolved,
|
||||||
* otherwise returns NULL
|
* otherwise returns NULL
|
||||||
*/
|
*/
|
||||||
Oid *
|
static Oid *
|
||||||
func_select_candidate(int nargs,
|
func_select_candidate(int nargs,
|
||||||
Oid *input_typeids,
|
Oid *input_typeids,
|
||||||
CandidateList candidates)
|
CandidateList candidates)
|
||||||
|
@ -586,7 +617,7 @@ func_select_candidate(int nargs,
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
static bool
|
||||||
func_get_detail(char *funcname,
|
func_get_detail(char *funcname,
|
||||||
int nargs,
|
int nargs,
|
||||||
Oid *oid_array,
|
Oid *oid_array,
|
||||||
|
@ -731,7 +762,7 @@ func_get_detail(char *funcname,
|
||||||
* not defined. There are lots of these (mostly builtins) in the
|
* not defined. There are lots of these (mostly builtins) in the
|
||||||
* catalogs.
|
* catalogs.
|
||||||
*/
|
*/
|
||||||
Oid **
|
static Oid **
|
||||||
argtype_inherit(int nargs, Oid *oid_array)
|
argtype_inherit(int nargs, Oid *oid_array)
|
||||||
{
|
{
|
||||||
Oid relid;
|
Oid relid;
|
||||||
|
@ -745,7 +776,7 @@ argtype_inherit(int nargs, Oid *oid_array)
|
||||||
arginh[i].self = oid_array[i];
|
arginh[i].self = oid_array[i];
|
||||||
if ((relid = typeidTypeRelid(oid_array[i])) != InvalidOid)
|
if ((relid = typeidTypeRelid(oid_array[i])) != InvalidOid)
|
||||||
{
|
{
|
||||||
arginh[i].nsupers = findsupers(relid, &(arginh[i].supervec));
|
arginh[i].nsupers = find_inheritors(relid, &(arginh[i].supervec));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -762,10 +793,10 @@ argtype_inherit(int nargs, Oid *oid_array)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return an ordered cross-product of the classes involved */
|
/* return an ordered cross-product of the classes involved */
|
||||||
return (genxprod(arginh, nargs));
|
return (gen_cross_product(arginh, nargs));
|
||||||
}
|
}
|
||||||
|
|
||||||
int findsupers(Oid relid, Oid **supervec)
|
static int find_inheritors(Oid relid, Oid **supervec)
|
||||||
{
|
{
|
||||||
Oid *relidvec;
|
Oid *relidvec;
|
||||||
Relation inhrel;
|
Relation inhrel;
|
||||||
|
@ -885,8 +916,8 @@ int findsupers(Oid relid, Oid **supervec)
|
||||||
return (nvisited);
|
return (nvisited);
|
||||||
}
|
}
|
||||||
|
|
||||||
Oid **
|
static Oid **
|
||||||
genxprod(InhPaths *arginh, int nargs)
|
gen_cross_product(InhPaths *arginh, int nargs)
|
||||||
{
|
{
|
||||||
int nanswers;
|
int nanswers;
|
||||||
Oid **result,
|
Oid **result,
|
||||||
|
@ -946,7 +977,7 @@ genxprod(InhPaths *arginh, int nargs)
|
||||||
** Given the number and types of arguments to a function, and the
|
** Given the number and types of arguments to a function, and the
|
||||||
** actual arguments and argument types, do the necessary typecasting.
|
** actual arguments and argument types, do the necessary typecasting.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
make_arguments(int nargs,
|
make_arguments(int nargs,
|
||||||
List *fargs,
|
List *fargs,
|
||||||
Oid *input_typeids,
|
Oid *input_typeids,
|
||||||
|
@ -987,7 +1018,7 @@ make_arguments(int nargs,
|
||||||
** on a tuple parameter or return value. Due to a bug in 4.0,
|
** on a tuple parameter or return value. Due to a bug in 4.0,
|
||||||
** it's not possible to refer to system attributes in this case.
|
** it's not possible to refer to system attributes in this case.
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
setup_tlist(char *attname, Oid relid)
|
setup_tlist(char *attname, Oid relid)
|
||||||
{
|
{
|
||||||
TargetEntry *tle;
|
TargetEntry *tle;
|
||||||
|
@ -1021,7 +1052,7 @@ setup_tlist(char *attname, Oid relid)
|
||||||
** Build a tlist that extracts a base type from the tuple
|
** Build a tlist that extracts a base type from the tuple
|
||||||
** returned by the executor.
|
** returned by the executor.
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
setup_base_tlist(Oid typeid)
|
setup_base_tlist(Oid typeid)
|
||||||
{
|
{
|
||||||
TargetEntry *tle;
|
TargetEntry *tle;
|
||||||
|
@ -1048,7 +1079,7 @@ setup_base_tlist(Oid typeid)
|
||||||
* handles function calls with a single argument that is of complex type.
|
* handles function calls with a single argument that is of complex type.
|
||||||
* This routine returns NULL if it can't handle the projection (eg. sets).
|
* This routine returns NULL if it can't handle the projection (eg. sets).
|
||||||
*/
|
*/
|
||||||
Node *
|
static Node *
|
||||||
ParseComplexProjection(ParseState *pstate,
|
ParseComplexProjection(ParseState *pstate,
|
||||||
char *funcname,
|
char *funcname,
|
||||||
Node *first_arg,
|
Node *first_arg,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.2 1997/11/26 01:11:22 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.3 1997/11/26 03:42:44 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -28,6 +28,12 @@
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
|
|
||||||
|
static void disallow_setop(char *op, Type optype, Node *operand);
|
||||||
|
static Node *make_operand(char *opname,
|
||||||
|
Node *tree,
|
||||||
|
Oid orig_typeId,
|
||||||
|
Oid true_typeId);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* make_parsestate() --
|
* make_parsestate() --
|
||||||
* allocate and initialize a new ParseState.
|
* allocate and initialize a new ParseState.
|
||||||
|
@ -56,7 +62,7 @@ make_parsestate(void)
|
||||||
return (pstate);
|
return (pstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *
|
static Node *
|
||||||
make_operand(char *opname,
|
make_operand(char *opname,
|
||||||
Node *tree,
|
Node *tree,
|
||||||
Oid orig_typeId,
|
Oid orig_typeId,
|
||||||
|
@ -110,7 +116,7 @@ make_operand(char *opname,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
disallow_setop(char *op, Type optype, Node *operand)
|
disallow_setop(char *op, Type optype, Node *operand)
|
||||||
{
|
{
|
||||||
if (operand == NULL)
|
if (operand == NULL)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.2 1997/11/26 01:11:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.3 1997/11/26 03:42:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -26,6 +26,21 @@
|
||||||
#include "storage/bufmgr.h"
|
#include "storage/bufmgr.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
|
|
||||||
|
static int binary_oper_get_candidates(char *opname,
|
||||||
|
Oid leftTypeId,
|
||||||
|
Oid rightTypeId,
|
||||||
|
CandidateList *candidates);
|
||||||
|
static CandidateList binary_oper_select_candidate(Oid arg1,
|
||||||
|
Oid arg2,
|
||||||
|
CandidateList candidates);
|
||||||
|
static bool equivalentOpersAfterPromotion(CandidateList candidates);
|
||||||
|
static void op_error(char *op, Oid arg1, Oid arg2);
|
||||||
|
static int unary_oper_get_candidates(char *op,
|
||||||
|
Oid typeId,
|
||||||
|
CandidateList *candidates,
|
||||||
|
char rightleft);
|
||||||
|
|
||||||
|
|
||||||
Oid
|
Oid
|
||||||
any_ordering_op(int restype)
|
any_ordering_op(int restype)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +66,7 @@ oprid(Operator op)
|
||||||
* opname exists, such that leftTypeId can be coerced to arg1 and
|
* opname exists, such that leftTypeId can be coerced to arg1 and
|
||||||
* rightTypeId can be coerced to arg2
|
* rightTypeId can be coerced to arg2
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
binary_oper_get_candidates(char *opname,
|
binary_oper_get_candidates(char *opname,
|
||||||
Oid leftTypeId,
|
Oid leftTypeId,
|
||||||
Oid rightTypeId,
|
Oid rightTypeId,
|
||||||
|
@ -149,7 +164,7 @@ binary_oper_get_candidates(char *opname,
|
||||||
* the all the candidates operate on the same data types after
|
* the all the candidates operate on the same data types after
|
||||||
* promotion (int2, int4, float4 -> float8).
|
* promotion (int2, int4, float4 -> float8).
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
equivalentOpersAfterPromotion(CandidateList candidates)
|
equivalentOpersAfterPromotion(CandidateList candidates)
|
||||||
{
|
{
|
||||||
CandidateList result;
|
CandidateList result;
|
||||||
|
@ -223,7 +238,7 @@ equivalentOpersAfterPromotion(CandidateList candidates)
|
||||||
* given a choice of argument type pairs for a binary operator,
|
* given a choice of argument type pairs for a binary operator,
|
||||||
* try to choose a default pair
|
* try to choose a default pair
|
||||||
*/
|
*/
|
||||||
CandidateList
|
static CandidateList
|
||||||
binary_oper_select_candidate(Oid arg1,
|
binary_oper_select_candidate(Oid arg1,
|
||||||
Oid arg2,
|
Oid arg2,
|
||||||
CandidateList candidates)
|
CandidateList candidates)
|
||||||
|
@ -366,7 +381,7 @@ oper(char *op, Oid arg1, Oid arg2, bool noWarnings)
|
||||||
* a right/left unary operator named opname exists,
|
* a right/left unary operator named opname exists,
|
||||||
* such that typeId can be coerced to it
|
* such that typeId can be coerced to it
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
unary_oper_get_candidates(char *op,
|
unary_oper_get_candidates(char *op,
|
||||||
Oid typeId,
|
Oid typeId,
|
||||||
CandidateList *candidates,
|
CandidateList *candidates,
|
||||||
|
@ -548,7 +563,7 @@ outstr(char *typename, /* Name of type of value */
|
||||||
* Give a somewhat useful error message when the operator for two types
|
* Give a somewhat useful error message when the operator for two types
|
||||||
* is not found.
|
* is not found.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
op_error(char *op, Oid arg1, Oid arg2)
|
op_error(char *op, Oid arg1, Oid arg2)
|
||||||
{
|
{
|
||||||
Type tp1 = NULL,
|
Type tp1 = NULL,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.2 1997/11/26 01:11:28 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.3 1997/11/26 03:42:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -24,6 +24,9 @@
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
|
||||||
|
static void checkTargetTypes(ParseState *pstate, char *target_colname,
|
||||||
|
char *refname, char *colname);
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
char *field;
|
char *field;
|
||||||
|
@ -415,7 +418,7 @@ handleTargetColname(ParseState *pstate, char **resname,
|
||||||
* checkTargetTypes -
|
* checkTargetTypes -
|
||||||
* checks value and target column types
|
* checks value and target column types
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
checkTargetTypes(ParseState *pstate, char *target_colname,
|
checkTargetTypes(ParseState *pstate, char *target_colname,
|
||||||
char *refname, char *colname)
|
char *refname, char *colname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.2 1997/11/26 01:11:30 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.3 1997/11/26 03:42:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -25,6 +25,13 @@
|
||||||
#include "parser/parse_target.h"
|
#include "parser/parse_target.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
|
|
||||||
|
static List *expandAllTables(ParseState *pstate);
|
||||||
|
static char *figureColname(Node *expr, Node *resval);
|
||||||
|
static TargetEntry *make_targetlist_expr(ParseState *pstate,
|
||||||
|
char *colname,
|
||||||
|
Node *expr,
|
||||||
|
List *arrayRef);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* transformTargetList -
|
* transformTargetList -
|
||||||
* turns a list of ResTarget's into a list of TargetEntry's
|
* turns a list of ResTarget's into a list of TargetEntry's
|
||||||
|
@ -310,7 +317,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||||
*
|
*
|
||||||
* arrayRef is a list of transformed A_Indices
|
* arrayRef is a list of transformed A_Indices
|
||||||
*/
|
*/
|
||||||
TargetEntry *
|
static TargetEntry *
|
||||||
make_targetlist_expr(ParseState *pstate,
|
make_targetlist_expr(ParseState *pstate,
|
||||||
char *colname,
|
char *colname,
|
||||||
Node *expr,
|
Node *expr,
|
||||||
|
@ -568,7 +575,7 @@ makeTargetNames(ParseState *pstate, List *cols)
|
||||||
* turns '*' (in the target list) into a list of attributes
|
* turns '*' (in the target list) into a list of attributes
|
||||||
* (of all relations in the range table)
|
* (of all relations in the range table)
|
||||||
*/
|
*/
|
||||||
List *
|
static List *
|
||||||
expandAllTables(ParseState *pstate)
|
expandAllTables(ParseState *pstate)
|
||||||
{
|
{
|
||||||
List *target = NIL;
|
List *target = NIL;
|
||||||
|
@ -633,7 +640,7 @@ expandAllTables(ParseState *pstate)
|
||||||
* list, we have to guess.
|
* list, we have to guess.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char *
|
static char *
|
||||||
figureColname(Node *expr, Node *resval)
|
figureColname(Node *expr, Node *resval)
|
||||||
{
|
{
|
||||||
switch (nodeTag(expr))
|
switch (nodeTag(expr))
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.11 1997/11/24 05:09:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.12 1997/11/26 03:42:58 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -24,6 +24,8 @@
|
||||||
#include "utils/palloc.h"
|
#include "utils/palloc.h"
|
||||||
#include "utils/tqual.h"
|
#include "utils/tqual.h"
|
||||||
|
|
||||||
|
static bool heapisoverride(void);
|
||||||
|
|
||||||
extern bool PostgresIsInitialized;
|
extern bool PostgresIsInitialized;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -49,8 +51,7 @@ setheapoverride(bool on)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
static bool
|
||||||
bool
|
|
||||||
heapisoverride()
|
heapisoverride()
|
||||||
{
|
{
|
||||||
if (!TransactionIdIsValid(HeapSpecialTransactionId))
|
if (!TransactionIdIsValid(HeapSpecialTransactionId))
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: gramparse.h,v 1.5 1997/09/08 21:53:37 momjian Exp $
|
* $Id: gramparse.h,v 1.6 1997/11/26 03:43:05 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
extern void init_io(void);
|
extern void init_io(void);
|
||||||
|
|
||||||
/* from gram.y */
|
/* from gram.y */
|
||||||
|
extern Oid param_type(int t);
|
||||||
extern void parser_init(Oid *typev, int nargs);
|
extern void parser_init(Oid *typev, int nargs);
|
||||||
extern int yyparse(void);
|
extern int yyparse(void);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_agg.h,v 1.2 1997/11/26 01:13:58 momjian Exp $
|
* $Id: parse_agg.h,v 1.3 1997/11/26 03:43:08 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -20,9 +20,6 @@
|
||||||
|
|
||||||
extern void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
|
extern void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
|
||||||
extern void finalizeAggregates(ParseState *pstate, Query *qry);
|
extern void finalizeAggregates(ParseState *pstate, Query *qry);
|
||||||
extern bool contain_agg_clause(Node *clause);
|
|
||||||
extern bool exprIsAggOrGroupCol(Node *expr, List *groupClause);
|
|
||||||
extern bool tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause);
|
|
||||||
extern void parseCheckAggregates(ParseState *pstate, Query *qry);
|
extern void parseCheckAggregates(ParseState *pstate, Query *qry);
|
||||||
extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
|
extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
|
||||||
extern void agg_error(char *caller, char *aggname, Oid basetypeID);
|
extern void agg_error(char *caller, char *aggname, Oid basetypeID);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_clause.h,v 1.2 1997/11/26 01:14:00 momjian Exp $
|
* $Id: parse_clause.h,v 1.3 1997/11/26 03:43:09 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -19,11 +19,8 @@
|
||||||
#include <nodes/primnodes.h>
|
#include <nodes/primnodes.h>
|
||||||
#include <parser/parse_node.h>
|
#include <parser/parse_node.h>
|
||||||
|
|
||||||
extern void parseFromClause(ParseState *pstate, List *frmList);
|
|
||||||
extern void makeRangeTable(ParseState *pstate, char *relname, List *frmList);
|
extern void makeRangeTable(ParseState *pstate, char *relname, List *frmList);
|
||||||
extern Node *transformWhereClause(ParseState *pstate, Node *a_expr);
|
extern Node *transformWhereClause(ParseState *pstate, Node *a_expr);
|
||||||
extern TargetEntry *find_targetlist_entry(ParseState *pstate,
|
|
||||||
SortGroupBy *sortgroupby, List *tlist);
|
|
||||||
extern List *transformGroupClause(ParseState *pstate, List *grouplist,
|
extern List *transformGroupClause(ParseState *pstate, List *grouplist,
|
||||||
List *targetlist);
|
List *targetlist);
|
||||||
extern List *transformSortClause(ParseState *pstate,
|
extern List *transformSortClause(ParseState *pstate,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_expr.h,v 1.2 1997/11/26 01:14:02 momjian Exp $
|
* $Id: parse_expr.h,v 1.3 1997/11/26 03:43:11 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,6 @@ extern Node *transformExpr(ParseState *pstate, Node *expr, int precedence);
|
||||||
extern Node *transformIdent(ParseState *pstate, Node *expr, int precedence);
|
extern Node *transformIdent(ParseState *pstate, Node *expr, int precedence);
|
||||||
extern Oid exprType(Node *expr);
|
extern Oid exprType(Node *expr);
|
||||||
extern Node *handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno);
|
extern Node *handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno);
|
||||||
extern Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
|
|
||||||
extern Node *parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen);
|
extern Node *parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen);
|
||||||
|
|
||||||
#endif /* PARSE_EXPR_H */
|
#endif /* PARSE_EXPR_H */
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_func.h,v 1.2 1997/11/26 01:14:04 momjian Exp $
|
* $Id: parse_func.h,v 1.3 1997/11/26 03:43:12 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -44,37 +44,7 @@ typedef struct _CandidateList
|
||||||
|
|
||||||
extern Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
extern Node *ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||||
int *curr_resno);
|
int *curr_resno);
|
||||||
extern Oid funcid_get_rettype(Oid funcid);
|
|
||||||
extern CandidateList func_get_candidates(char *funcname, int nargs);
|
|
||||||
extern bool can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids);
|
|
||||||
extern int match_argtypes(int nargs,
|
|
||||||
Oid *input_typeids,
|
|
||||||
CandidateList function_typeids,
|
|
||||||
CandidateList *candidates);
|
|
||||||
extern Oid * func_select_candidate(int nargs,
|
|
||||||
Oid *input_typeids,
|
|
||||||
CandidateList candidates);
|
|
||||||
extern bool func_get_detail(char *funcname,
|
|
||||||
int nargs,
|
|
||||||
Oid *oid_array,
|
|
||||||
Oid *funcid, /* return value */
|
|
||||||
Oid *rettype, /* return value */
|
|
||||||
bool *retset, /* return value */
|
|
||||||
Oid **true_typeids);
|
|
||||||
extern Oid ** argtype_inherit(int nargs, Oid *oid_array);
|
|
||||||
extern int findsupers(Oid relid, Oid **supervec);
|
|
||||||
extern Oid **genxprod(InhPaths *arginh, int nargs);
|
|
||||||
extern void make_arguments(int nargs,
|
|
||||||
List *fargs,
|
|
||||||
Oid *input_typeids,
|
|
||||||
Oid *function_typeids);
|
|
||||||
|
|
||||||
extern List *setup_tlist(char *attname, Oid relid);
|
|
||||||
extern List *setup_base_tlist(Oid typeid);
|
|
||||||
extern Node *ParseComplexProjection(ParseState *pstate,
|
|
||||||
char *funcname,
|
|
||||||
Node *first_arg,
|
|
||||||
bool *attisset);
|
|
||||||
extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
|
extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
|
||||||
|
|
||||||
#endif /* PARSE_FUNC_H */
|
#endif /* PARSE_FUNC_H */
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_node.h,v 1.2 1997/11/26 01:14:05 momjian Exp $
|
* $Id: parse_node.h,v 1.3 1997/11/26 03:43:13 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -42,11 +42,6 @@ typedef struct ParseState
|
||||||
} ParseState;
|
} ParseState;
|
||||||
|
|
||||||
extern ParseState *make_parsestate(void);
|
extern ParseState *make_parsestate(void);
|
||||||
extern Node *make_operand(char *opname,
|
|
||||||
Node *tree,
|
|
||||||
Oid orig_typeId,
|
|
||||||
Oid true_typeId);
|
|
||||||
extern void disallow_setop(char *op, Type optype, Node *operand);
|
|
||||||
extern Expr *make_op(char *opname, Node *ltree, Node *rtree);
|
extern Expr *make_op(char *opname, Node *ltree, Node *rtree);
|
||||||
extern Var *make_var(ParseState *pstate, char *refname, char *attrname, Oid *type_id);
|
extern Var *make_var(ParseState *pstate, char *refname, char *attrname, Oid *type_id);
|
||||||
extern ArrayRef *make_array_ref(Node *expr,
|
extern ArrayRef *make_array_ref(Node *expr,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_oper.h,v 1.2 1997/11/26 01:14:07 momjian Exp $
|
* $Id: parse_oper.h,v 1.3 1997/11/26 03:43:14 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -20,21 +20,8 @@ typedef HeapTuple Operator;
|
||||||
|
|
||||||
extern Oid any_ordering_op(int restype);
|
extern Oid any_ordering_op(int restype);
|
||||||
extern Oid oprid(Operator op);
|
extern Oid oprid(Operator op);
|
||||||
extern int binary_oper_get_candidates(char *opname,
|
|
||||||
Oid leftTypeId,
|
|
||||||
Oid rightTypeId,
|
|
||||||
CandidateList *candidates);
|
|
||||||
extern bool equivalentOpersAfterPromotion(CandidateList candidates);
|
|
||||||
extern CandidateList binary_oper_select_candidate(Oid arg1,
|
|
||||||
Oid arg2,
|
|
||||||
CandidateList candidates);
|
|
||||||
extern Operator oper(char *op, Oid arg1, Oid arg2, bool noWarnings);
|
extern Operator oper(char *op, Oid arg1, Oid arg2, bool noWarnings);
|
||||||
extern int unary_oper_get_candidates(char *op,
|
|
||||||
Oid typeId,
|
|
||||||
CandidateList *candidates,
|
|
||||||
char rightleft);
|
|
||||||
extern Operator right_oper(char *op, Oid arg);
|
extern Operator right_oper(char *op, Oid arg);
|
||||||
extern Operator left_oper(char *op, Oid arg);
|
extern Operator left_oper(char *op, Oid arg);
|
||||||
extern void op_error(char *op, Oid arg1, Oid arg2);
|
|
||||||
|
|
||||||
#endif /* PARSE_OPER_H */
|
#endif /* PARSE_OPER_H */
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_relation.h,v 1.2 1997/11/26 01:14:08 momjian Exp $
|
* $Id: parse_relation.h,v 1.3 1997/11/26 03:43:16 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +38,5 @@ extern Oid attnameTypeId(Oid relid, char *attrname);
|
||||||
extern Oid attnumTypeId(Relation rd, int attid);
|
extern Oid attnumTypeId(Relation rd, int attid);
|
||||||
extern void handleTargetColname(ParseState *pstate, char **resname,
|
extern void handleTargetColname(ParseState *pstate, char **resname,
|
||||||
char *refname, char *colname);
|
char *refname, char *colname);
|
||||||
extern void checkTargetTypes(ParseState *pstate, char *target_colname,
|
|
||||||
char *refname, char *colname);
|
|
||||||
|
|
||||||
#endif /* PARSE_RANGE_H */
|
#endif /* PARSE_RANGE_H */
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parse_target.h,v 1.2 1997/11/26 01:14:10 momjian Exp $
|
* $Id: parse_target.h,v 1.3 1997/11/26 03:43:18 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -23,12 +23,6 @@
|
||||||
#define EXPR_RELATION_FIRST 2
|
#define EXPR_RELATION_FIRST 2
|
||||||
|
|
||||||
extern List *transformTargetList(ParseState *pstate, List *targetlist);
|
extern List *transformTargetList(ParseState *pstate, List *targetlist);
|
||||||
extern TargetEntry *make_targetlist_expr(ParseState *pstate,
|
|
||||||
char *colname,
|
|
||||||
Node *expr,
|
|
||||||
List *arrayRef);
|
|
||||||
extern List *expandAllTables(ParseState *pstate);
|
|
||||||
extern char *figureColname(Node *expr, Node *resval);
|
|
||||||
extern List *makeTargetNames(ParseState *pstate, List *cols);
|
extern List *makeTargetNames(ParseState *pstate, List *cols);
|
||||||
|
|
||||||
#endif /* PARSE_TARGET_H */
|
#endif /* PARSE_TARGET_H */
|
||||||
|
|
Loading…
Reference in New Issue