Re: When do we lose column names? - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: When do we lose column names?
Date
Msg-id 4F307F54.5020608@dunslane.net
Whole thread Raw
In response to Re: When do we lose column names?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: When do we lose column names?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 11/16/2011 10:38 PM, Tom Lane wrote:
> I wrote:
>> PFC, a patch that does this.
> Upon further review, this patch would need some more work even for the
> RowExpr case, because there are several places that build RowExprs
> without bothering to build a valid colnames list.  It's clearly soluble
> if anyone cares to put in the work, but I'm not personally excited
> enough to pursue it ...


The patch itself causes a core dump with the current regression tests. 
This test:
   SELECT array_to_json(array_agg(q),false)      FROM ( SELECT $$a$$ || x AS b, y AS c,
ARRAY[ROW(x.*,ARRAY[1,2,3]),                  ROW(y.*,ARRAY[4,5,6])] AS z             FROM generate_series(1,2) x,
           generate_series(4,5) y) q;
 


causes a failure at line 967 of execTuples.c:
   Assert(list_length(exprList) == list_length(namesList));

I'm investigating further.

I've been looking at the other places that build RowExprs. Most of them 
look OK and none seem clearly in need of fixing at first glance. Which 
do you think need attention?

cheers

andrew



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Progress on fast path sorting, btree index creation time
Next
From: Dan Scales
Date:
Subject: Re: double writes using "double-write buffer" approach [WIP]