Re: weird cast behavior in "IN (values)" clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: weird cast behavior in "IN (values)" clause
Date: 2011-07-06 04:24:09
Message-ID: 27136.1309926249@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-07-06 05:19:45 Re: Range Types, constructors, and the type system
Previous Message Alvaro Herrera 2011-07-06 02:10:23 weird cast behavior in "IN (values)" clause