diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-03-19 20:29:08 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-03-19 20:30:08 -0400 |
commit | b310b6e31ce5aa9e456c43c0e8e93248b0c84c02 (patch) | |
tree | e5168fcfdb231a9889e87e309f38a9e0f05a7896 /src/include/nodes/nodeFuncs.h | |
parent | 025f4c72f029242a6aaf3f14bb6d7da4ce070f72 (diff) | |
download | postgresql-b310b6e31ce5aa9e456c43c0e8e93248b0c84c02.tar.gz postgresql-b310b6e31ce5aa9e456c43c0e8e93248b0c84c02.zip |
Revise collation derivation method and expression-tree representation.
All expression nodes now have an explicit output-collation field, unless
they are known to only return a noncollatable data type (such as boolean
or record). Also, nodes that can invoke collation-aware functions store
a separate field that is the collation value to pass to the function.
This avoids confusion that arises when a function has collatable inputs
and noncollatable output type, or vice versa.
Also, replace the parser's on-the-fly collation assignment method with
a post-pass over the completed expression tree. This allows us to use
a more complex (and hopefully more nearly spec-compliant) assignment
rule without paying for it in extra storage in every expression node.
Fix assorted bugs in the planner's handling of collations by making
collation one of the defining properties of an EquivalenceClass and
by converting CollateExprs into discardable RelabelType nodes during
expression preprocessing.
Diffstat (limited to 'src/include/nodes/nodeFuncs.h')
-rw-r--r-- | src/include/nodes/nodeFuncs.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/nodes/nodeFuncs.h b/src/include/nodes/nodeFuncs.h index 32f09f68ad1..591f2a9ca03 100644 --- a/src/include/nodes/nodeFuncs.h +++ b/src/include/nodes/nodeFuncs.h @@ -21,17 +21,21 @@ #define QTW_IGNORE_CTE_SUBQUERIES 0x02 /* subqueries in cteList */ #define QTW_IGNORE_RC_SUBQUERIES 0x03 /* both of above */ #define QTW_IGNORE_JOINALIASES 0x04 /* JOIN alias var lists */ -#define QTW_EXAMINE_RTES 0x08 /* examine RTEs */ -#define QTW_DONT_COPY_QUERY 0x10 /* do not copy top Query */ +#define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */ +#define QTW_EXAMINE_RTES 0x10 /* examine RTEs */ +#define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */ extern Oid exprType(Node *expr); extern int32 exprTypmod(Node *expr); -extern Oid exprCollation(Node *expr); -extern Oid coercion_expression_result_collation(Oid resulttype, Node *arg); extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod); extern bool expression_returns_set(Node *clause); +extern Oid exprCollation(Node *expr); +extern Oid exprInputCollation(Node *expr); +extern void exprSetCollation(Node *expr, Oid collation); +extern void exprSetInputCollation(Node *expr, Oid inputcollation); + extern int exprLocation(Node *expr); extern bool expression_tree_walker(Node *node, bool (*walker) (), |