pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: postgresql@realityexists.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8393: "ERROR: failed to locate grouping columns" on grouping by varchar returned from function
Date: Fri, 23 Aug 2013 17:35:34 -0400
Message-ID: <22855.1377293734@sss.pgh.pa.us> (raw)
In-Reply-To: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org>
References: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

postgresql@realityexists.net writes:
> CREATE OR REPLACE FUNCTION test_group_by()
> RETURNS TABLE (my_col varchar(5))
> AS $BODY$
>     SELECT 'hello'::varchar(5);
> $BODY$ LANGUAGE sql STABLE;

> SELECT my_col
> FROM test_group_by()
> GROUP BY 1;

> ERROR:  failed to locate grouping columns

Fixed in our git tree; thanks for the report!

As a workaround in this particular case, you could just not bother with
marking the specific length of the varchar constant.  The function
definition essentially ignores the length, storing only "varchar" as the
result column type, and it's the discrepancy between that and the
declaration of the constant that's tickling the bug.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <22855.1377293734@sss.pgh.pa.us>
Permalink:  ../22855.1377293734@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22855.1377293734@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgresql@realityexists.net
  Subject: Re: BUG #8393: "ERROR: failed to locate grouping columns" on grouping by varchar returned from function
  In-Reply-To: <22855.1377293734@sss.pgh.pa.us>
  References: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org> <22855.1377293734@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox