Header And Logo

PostgreSQL
| The world's most advanced open source database.

var.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * var.h
00004  *    prototypes for optimizer/util/var.c.
00005  *
00006  *
00007  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00008  * Portions Copyright (c) 1994, Regents of the University of California
00009  *
00010  * src/include/optimizer/var.h
00011  *
00012  *-------------------------------------------------------------------------
00013  */
00014 #ifndef VAR_H
00015 #define VAR_H
00016 
00017 #include "nodes/relation.h"
00018 
00019 typedef enum
00020 {
00021     PVC_REJECT_AGGREGATES,      /* throw error if Aggref found */
00022     PVC_INCLUDE_AGGREGATES,     /* include Aggrefs in output list */
00023     PVC_RECURSE_AGGREGATES      /* recurse into Aggref arguments */
00024 } PVCAggregateBehavior;
00025 
00026 typedef enum
00027 {
00028     PVC_REJECT_PLACEHOLDERS,    /* throw error if PlaceHolderVar found */
00029     PVC_INCLUDE_PLACEHOLDERS,   /* include PlaceHolderVars in output list */
00030     PVC_RECURSE_PLACEHOLDERS    /* recurse into PlaceHolderVar arguments */
00031 } PVCPlaceHolderBehavior;
00032 
00033 extern Relids pull_varnos(Node *node);
00034 extern Relids pull_varnos_of_level(Node *node, int levelsup);
00035 extern void pull_varattnos(Node *node, Index varno, Bitmapset **varattnos);
00036 extern List *pull_vars_of_level(Node *node, int levelsup);
00037 extern bool contain_var_clause(Node *node);
00038 extern bool contain_vars_of_level(Node *node, int levelsup);
00039 extern int  locate_var_of_level(Node *node, int levelsup);
00040 extern List *pull_var_clause(Node *node, PVCAggregateBehavior aggbehavior,
00041                 PVCPlaceHolderBehavior phbehavior);
00042 extern Node *flatten_join_alias_vars(PlannerInfo *root, Node *node);
00043 
00044 #endif   /* VAR_H */