Re: row literal problem

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: row literal problem
Date: 2012-07-18 19:18:27
Message-ID: CAHyXU0y2ixy4B+0vmn03sx5YHh8a_yPwsQZDBfHGH4MgspZ+bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 18, 2012 at 1:58 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> I'm chasing up an issue from a client who has this problem (in 9.1):
>
> with q as
> (
> some query here
> )
> select q.* from q
>
> yields:
>
> job_scope | checked_col
> -----------------------------------------------+------------------------------------------
> Co Revenues: Co Revenues $100 to $999 Million | <input panel=data
> type=checkbox checked>
> Metropolitan Area: Austin-Round Rock | <input panel=data
> type=checkbox checked>
>
> which is as expected.
>
> However,
>
> with q as
> (
> same query here
> )
> select q from q
>
> yields:
>
> q
> -----------------------------------------------------------------------------------------------
> ("Co Revenues: Co Revenues $100 to $999 Million","<input panel=data
> type=checkbox checked>",)
> ("Metropolitan Area: Austin-Round Rock","<input panel=data type=checkbox
> checked>",)
>
>
> Note the trailing comma inside the (), which certainly looks bogus to me. If
> I replace "select q" with "select row(q.*)" it disappears.
>
> It doesn't happen in all cases, and I'm trying to work out a minimal
> reproducible example. But it sure is puzzling.

there are no null fields, right? if the last field is sometimes null
you'd see that (you probably ruled that out though). when you say
'sometimes', do you mean for some rows and not others? or for some
queries?

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-07-18 19:27:45 Re: row literal problem
Previous Message Andrew Dunstan 2012-07-18 18:58:22 row literal problem