pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: postgresql@realityexists.net
To: pgsql-bugs@postgresql.org
Subject: BUG #8393: "ERROR: failed to locate grouping columns" on grouping by varchar returned from function
Date: Fri, 23 Aug 2013 08:25:15 +0000
Message-ID: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8393
Logged by:          Evan Martin
Email address:      postgresql@realityexists.net
PostgreSQL version: 9.2.4
Operating system:   Windows 7 x64 SP1
Description:        

version(): PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 64-bit


Run the following:


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;




Expected result:


'hello'


Actual result:


ERROR:  failed to locate grouping columns


Interestingly, if the function is marked "VOLATILE" it works. Casting the
result to "text" also makes it work.



-- 
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)  latest in thread

Message-ID: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org>
Permalink:  ../E1VCmgF-0001uF-9I@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VCmgF-0001uF-9I@wrigleys.postgresql.org

 · 

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: postgresql@realityexists.net
  Subject: Re: BUG #8393: "ERROR: failed to locate grouping columns" on grouping by varchar returned from function
  In-Reply-To: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org>
  References: <E1VCmgF-0001uF-9I@wrigleys.postgresql.org>

* 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