Re: Over-optimization in ExecEvalWholeRowVar - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Over-optimization in ExecEvalWholeRowVar
Date
Msg-id CAHyXU0xrVUwuR9LqRD2DVstjRB_2CoaKTOCWpBM_3CQxbWzL+g@mail.gmail.com
Whole thread Raw
In response to Over-optimization in ExecEvalWholeRowVar  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jul 11, 2014 at 2:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> This example in the regression database is a simplified version of a bug
> I was shown off-list:
>
> regression=# select (
> select q from
> ( select 1,2,3 where f1>0
>   union all
>   select 4,5,6.0 where f1<=0
> ) q
> )
> from int4_tbl;
> ERROR:  record type has not been registered

Thanks Tom!

If anybody gets hit by this, the workaround I use is to put the inner
subquery as a CTE:
select (select q from(    with data as (    select 1,2,3 where f1>0    union all    select 4,5,6.0 where f1<=0  )
select* from data) q)from int4_tbl;
 

merlin



pgsql-hackers by date:

Previous
From: Fabrízio de Royes Mello
Date:
Subject: Re: 9.5 CF1
Next
From: Tom Lane
Date:
Subject: Re: Allowing NOT IN to use ANTI joins