From: stefanov.sm@abv.bg
To: pgsql-bugs@postgresql.org
Subject: BUG #13751: PGAdmin III function text error
Date: Fri, 30 Oct 2015 20:14:00 +0000
Message-ID: <20151030201400.3017.89775@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: 13751
Logged by: Stefan Stefanov
Email address: stefanov.sm@abv.bg
PostgreSQL version: 9.5beta1
Operating system: Windows 7 x64
Description:
Define this function:
CREATE OR REPLACE FUNCTION demi.order_stat() RETURNS SETOF
demi.order_status_type AS
$BODY$
SELECT mr.id AS "Партида", mr.name AS "Група клиенти",
COUNT(*) FILTER (WHERE sl.value = 0) AS "Непретеглени",
COUNT(*) AS "Всички"
FROM demi.master mr INNER JOIN demi.slave sl ON mr.id = sl.master_id
WHERE mr.ready = 0
GROUP BY mr.id, mr.name;
$BODY$
LANGUAGE sql STABLE;
When you select the function in Object browser or rightclick-Scripts-Create
scrit then the script has an extra SETOF:
-- Function: demi.order_stat()
-- DROP FUNCTION demi.order_stat();
CREATE OR REPLACE FUNCTION demi.order_stat()
RETURNS SETOF SETOF demi.order_status_type AS
$BODY$
SELECT mr.id AS "Партида", mr.name AS "Група клиенти",
COUNT(*) FILTER (WHERE sl.value = 0) AS "Непретеглени",
COUNT(*) AS "Всички"
FROM demi.master mr INNER JOIN demi.slave sl ON mr.id = sl.master_id
WHERE mr.ready = 0
GROUP BY mr.id, mr.name;
$BODY$
LANGUAGE sql STABLE
COST 100
ROWS 1000;
ALTER FUNCTION demi.order_stat()
OWNER TO postgres;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: stefanov.sm@abv.bg
Subject: Re: BUG #13751: PGAdmin III function text error
In-Reply-To: <20151030201400.3017.89775@wrigleys.postgresql.org>
References: <20151030201400.3017.89775@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