Re: weird cast behavior in "IN (values)" clause - Mailing list pgsql-hackers

From Tom Lane
Subject Re: weird cast behavior in "IN (values)" clause
Date
Msg-id 27136.1309926249@sss.pgh.pa.us
Whole thread Raw
In response to weird cast behavior in "IN (values)" clause  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I am not sure why it would be valid to list two literals in the values
> but not one.

The discrepancy seems to be because transformAExprIn uses a different
type resolution method when there's more than one non-Var in the RHS.

Maybe we should apply select_common_type even when there's only one
RHS non-Var, even though we don't want to use a ScalarArrayOpExpr?

Curious that it's acted like this since 8.2 and nobody complained.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: weird cast behavior in "IN (values)" clause
Next
From: Jeff Davis
Date:
Subject: Re: Range Types, constructors, and the type system