1
/*-------------------------------------------------------------------------
4
* All node routines more complicated than simple access/modification
6
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
11
* $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.26 2004-12-31 21:59:55 pgsql Exp $
13
*-------------------------------------------------------------------------
17
#include "nodes/nodeFuncs.h"
20
static bool var_is_inner(Var *var);
25
* Returns t if node corresponds to a single-noded expression
28
single_node(Node *node)
30
if (IsA(node, Const) ||
38
/*****************************************************************************
40
*****************************************************************************/
48
* Returns t iff the var node corresponds to (respectively):
49
* the outer relation in a join
50
* the inner relation of a join
51
* a materialized relation
52
* a base relation (i.e., not an attribute reference, a variable from
53
* some lower join level, or a sort result)
54
* var node is an array reference
58
var_is_outer(Var *var)
60
return (bool) (var->varno == OUTER);
64
var_is_inner(Var *var)
66
return (bool) (var->varno == INNER);
73
!(var_is_inner(var) || var_is_outer(var));