Re: Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set") - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")
Date
Msg-id 29773.1389064996@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")  (David Johnston <polobo@yahoo.com>)
Responses Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")
List pgsql-hackers
David Johnston <polobo@yahoo.com> writes:
> The whole "varchar/varchar(30)" discrepancy is bothersome and since the
> example forces a function-call via the use of "lower(...)", and doesn't test
> the non-function situation, I am concerned this patch is incorrect.

The reason casting to varchar(30) fails is that that results in invocation
of a function (to enforce the length limit).  Casting to varchar is just a
RelabelType operation, which doesn't have two different code paths for
set and not-set inputs.

I did check the patch against your original example, but I thought using
lower() made the purpose of the regression test case more apparent.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Get more from indices.
Next
From: David Johnston
Date:
Subject: Re: Fixing bug #8228 ("set-valued function called in context that cannot accept a set")