Re: BUG #3259: Problem with automatic string cast - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3259: Problem with automatic string cast
Date
Msg-id 17031.1178030183@sss.pgh.pa.us
Whole thread Raw
In response to BUG #3259: Problem with automatic string cast  ("Thomas" <thbley@gmail.com>)
Responses Re: BUG #3259: Problem with automatic string cast  (Thomas Bley <thomas.bley@simple-groupware.de>)
List pgsql-bugs
"Thomas" <thbley@gmail.com> writes:
> select * from (select 'years' as recurrence) p where recurrence = 'years'
> it gives:
> ERROR: failed to find conversion function from "unknown" to text

Try casting the unknown value to some specific type, eg

regression=# select * from (select 'years'::text as recurrence) p where recurrence = 'years';
 recurrence
------------
 years
(1 row)

Do you have a less artificial example where not resolving the
subselect's output type is a problem?  We could change it to
force the type to text sooner, but I'm afraid that that would
break other people's usages.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Thomas"
Date:
Subject: BUG #3259: Problem with automatic string cast
Next
From: Thomas Bley
Date:
Subject: Re: BUG #3259: Problem with automatic string cast