~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/include/parser/parse_node.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * parse_node.h
 
4
 *              Internal definitions for parser
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * $PostgreSQL: pgsql/src/include/parser/parse_node.h,v 1.42 2004-12-31 22:03:38 pgsql Exp $
 
11
 *
 
12
 *-------------------------------------------------------------------------
 
13
 */
 
14
#ifndef PARSE_NODE_H
 
15
#define PARSE_NODE_H
 
16
 
 
17
#include "nodes/parsenodes.h"
 
18
#include "utils/rel.h"
 
19
 
 
20
/*
 
21
 * State information used during parse analysis
 
22
 *
 
23
 * p_rtable: list of RTEs that will become the rangetable of the query.
 
24
 * Note that neither relname nor refname of these entries are necessarily
 
25
 * unique; searching the rtable by name is a bad idea.
 
26
 *
 
27
 * p_joinlist: list of join items (RangeTblRef and JoinExpr nodes) that
 
28
 * will become the fromlist of the query's top-level FromExpr node.
 
29
 *
 
30
 * p_namespace: list of join items that represents the current namespace
 
31
 * for table and column lookup.  This may be just a subset of the rtable +
 
32
 * joinlist, and/or may contain entries that are not yet added to the main
 
33
 * joinlist.  Note that an RTE that is present in p_namespace, but does not
 
34
 * have its inFromCl flag set, is accessible only with an explicit qualifier;
 
35
 * lookups of unqualified column names should ignore it.
 
36
 *
 
37
 * p_paramtypes: an array of p_numparams type OIDs for $n parameter symbols
 
38
 * (zeroth entry in array corresponds to $1).  If p_variableparams is true, the
 
39
 * set of param types is not predetermined; in that case, a zero array entry
 
40
 * means that parameter number hasn't been seen, and UNKNOWNOID means the
 
41
 * parameter has been used but its type is not yet known.  NOTE: in a stack
 
42
 * of ParseStates, only the topmost ParseState contains paramtype info; but
 
43
 * we copy the p_variableparams flag down to the child nodes for speed in
 
44
 * coerce_type.
 
45
 */
 
46
typedef struct ParseState
 
47
{
 
48
        struct ParseState *parentParseState;            /* stack link */
 
49
        List       *p_rtable;           /* range table so far */
 
50
        List       *p_joinlist;         /* join items so far (will become FromExpr
 
51
                                                                 * node's fromlist) */
 
52
        List       *p_namespace;        /* current lookup namespace (join items) */
 
53
        Oid                *p_paramtypes;       /* OIDs of types for $n parameter symbols */
 
54
        int                     p_numparams;    /* allocated size of p_paramtypes[] */
 
55
        int                     p_next_resno;   /* next targetlist resno to assign */
 
56
        List       *p_forUpdate;        /* FOR UPDATE clause, if any (see gram.y) */
 
57
        Node       *p_value_substitute;         /* what to replace VALUE with, if
 
58
                                                                                 * any */
 
59
        bool            p_variableparams;
 
60
        bool            p_hasAggs;
 
61
        bool            p_hasSubLinks;
 
62
        bool            p_is_insert;
 
63
        bool            p_is_update;
 
64
        Relation        p_target_relation;
 
65
        RangeTblEntry *p_target_rangetblentry;
 
66
} ParseState;
 
67
 
 
68
extern ParseState *make_parsestate(ParseState *parentParseState);
 
69
extern Var *make_var(ParseState *pstate, RangeTblEntry *rte, int attrno);
 
70
extern Oid      transformArrayType(Oid arrayType);
 
71
extern ArrayRef *transformArraySubscripts(ParseState *pstate,
 
72
                                                 Node *arrayBase,
 
73
                                                 Oid arrayType,
 
74
                                                 Oid elementType,
 
75
                                                 int32 elementTypMod,
 
76
                                                 List *indirection,
 
77
                                                 Node *assignFrom);
 
78
extern Const *make_const(Value *value);
 
79
 
 
80
#endif   /* PARSE_NODE_H */