Re: When do we lose column names?

From: Andrew Dunstan <adunstan(at)postgresql(dot)org>
To:
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: When do we lose column names?
Date: 2012-02-11 16:11:09
Message-ID: 4F36931D.2000002@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/09/2012 03:06 PM, Andrew Dunstan wrote:
>
>
> On 02/09/2012 02:54 PM, Tom Lane wrote:
>> Andrew Dunstan<andrew(at)dunslane(dot)net> writes:
>>> OK, the one place that needs to be fixed to avoid the crash caused by
>>> the json regression tests with the original patch is in
>>> src/backend/parser/parse_expr.c:transformRowExpr().
>>> Other candidates I have found that don't set colnames and should
>>> probably use dummy names are:
>>> * src/backend/parser/gram.y (row: production)
>>> *
>>> src/backend/optimizer/prep/prepunion.c:adjust_appendrel_attrs_mutator()
>>> * src/backend/optimizer/util/var.c:flatten_join_alias_vars_mutator()
>> Hm, can't the last two get real column names from somewhere?
>
> Possibly. I'll dig a bit deeper.
>

I've had a look at these two. It's at least not obvious to me how to do
this simply, if at all. In the last case it looks like we'd need to
process the object recursively just like we do to extract the field
values, and I don't know where to get them in the appendrel case at all,
possibly because I'm not very familiar with this code.

Do we actually need to bother with these cases? The regression tests
pass without touching them, either because they don't matter or because
we don't have a test for these cases that would tickle the assertion
that was failing. If they don't matter, would it not be better just to
note that in the code rather than building a list of field names for no
good purpose?

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-02-11 18:18:59 Re: auto_explain produces invalid JSON
Previous Message Jesper Krogh 2012-02-11 12:16:08 Re: index-only quals vs. security_barrier views