Joe Conway <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Joe, do you recall the reasoning for this code in parse_coerce.c? >> [much snipped]
> Does the RelabelType keep a record of what was relabeled (I presume from > your description above it does)? The RelabelType node itself doesn't, but you can look to its input node to see the initial type. The code I was imagining adding to get_fn_expr_argtype would go like while (<node is a RelabelType with output ANYELEMENT/ANYARRAY/ANY>) node := node->input; to chain down to the first thing that isn't a Relabel. You can see examples of this coding pattern in various places in the optimizer that want to ignore binary-compatible relabelings. > The original code above predates get_fn_expr_argtype() I think, Oh, okay, if the coding predates 7.4 then I'm not so concerned about it. I was afraid we'd done this as of 7.4, in which case there's no field experience to indicate that it's really safe in corner cases. I have found a workaround for my immediate problem with indexing behavior, so I think we can leave parse_coerce.c as-is for the moment, but I'm planning to keep my eyes open for any evidence that we ought to reconsider the decision to omit RelabelType here. When RelabelType was put in, the intention was that it would appear *anywhere* that the actual output of one expression didn't match the expected input type of its parent. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]