aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-05-19 21:17:52 +0200
committerAndres Freund <andres@anarazel.de>2015-05-19 21:21:27 +0200
commit0740cbd7593d871858c352fab29a59cf7fa54b00 (patch)
treec535673374c68e75b4e68cd2ab95ed1d65047a25 /src/backend/parser/parse_clause.c
parentb48437d11b9389d724c037385a5cae824d4f8049 (diff)
downloadpostgresql-0740cbd7593d871858c352fab29a59cf7fa54b00.tar.gz
postgresql-0740cbd7593d871858c352fab29a59cf7fa54b00.zip
Refactor ON CONFLICT index inference parse tree representation.
Defer lookup of opfamily and input type of a of a user specified opclass until the optimizer selects among available unique indexes; and store the opclass in the parse analyzed tree instead. The primary reason for doing this is that for rule deparsing it's easier to use the opclass than the previous representation. While at it also rename a variable in the inference code to better fit it's purpose. This is separate from the actual fixes for deparsing to make review easier.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index a90bcf40c9d..c8af5ab1d05 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -2730,18 +2730,10 @@ resolve_unique_index_expr(ParseState *pstate, InferClause *infer,
exprLocation(pInfer->expr));
if (!ielem->opclass)
- {
- pInfer->inferopfamily = InvalidOid;
- pInfer->inferopcinputtype = InvalidOid;
- }
+ pInfer->inferopclass = InvalidOid;
else
- {
- Oid opclass = get_opclass_oid(BTREE_AM_OID, ielem->opclass,
- false);
-
- pInfer->inferopfamily = get_opclass_family(opclass);
- pInfer->inferopcinputtype = get_opclass_input_type(opclass);
- }
+ pInfer->inferopclass = get_opclass_oid(BTREE_AM_OID,
+ ielem->opclass, false);
result = lappend(result, pInfer);
}