postgresql/src/include/optimizer/clauses.h

59 lines
1.9 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* clauses.h
* prototypes for clauses.c.
*
*
* Copyright (c) 1994, Regents of the University of California
*
1999-05-25 12:15:34 -04:00
* $Id: clauses.h,v 1.17 1999/05/25 16:14:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef CLAUSES_H
#define CLAUSES_H
1996-11-06 04:19:16 -05:00
#include <nodes/primnodes.h>
1999-02-17 19:49:48 -05:00
#include <nodes/relation.h>
extern Expr *make_clause(int type, Node *oper, List *args);
extern bool is_opclause(Node *clause);
extern Expr *make_opclause(Oper *op, Var *leftop, Var *rightop);
extern Var *get_leftop(Expr *clause);
extern Var *get_rightop(Expr *clause);
extern bool is_funcclause(Node *clause);
extern Expr *make_funcclause(Func *func, List *funcargs);
extern bool or_clause(Node *clause);
extern Expr *make_orclause(List *orclauses);
extern bool not_clause(Node *clause);
extern Expr *make_notclause(Expr *notclause);
extern Expr *get_notclausearg(Expr *notclause);
extern bool and_clause(Node *clause);
extern Expr *make_andclause(List *andclauses);
1998-12-04 10:34:49 -05:00
extern bool case_clause(Node *clause);
extern List *pull_constant_clauses(List *quals, List **constantQual);
1999-05-25 12:15:34 -04:00
extern void clause_get_relids_vars(Node *clause, Relids * relids, List **vars);
extern int NumRelids(Node *clause);
extern bool contains_not(Node *clause);
extern bool is_joinable(Node *clause);
extern bool qual_clause_p(Node *clause);
extern void fix_opid(Node *clause);
extern List *fix_opids(List *clauses);
extern void get_relattval(Node *clause, int *relid,
AttrNumber *attno, Datum *constval, int *flag);
extern void get_rels_atts(Node *clause, int *relid1,
1997-09-08 16:59:27 -04:00
AttrNumber *attno1, int *relid2, AttrNumber *attno2);
extern void CommuteClause(Node *clause);
#define is_subplan(clause) ((Node*) clause != NULL && \
1998-02-12 22:46:56 -05:00
nodeTag((Node*) clause) == T_Expr && \
((Expr *) clause)->opType == SUBPLAN_EXPR)
#endif /* CLAUSES_H */