BUG #13751: PGAdmin III function text error - Mailing list pgsql-bugs

From stefanov.sm@abv.bg
Subject BUG #13751: PGAdmin III function text error
Date
Msg-id 20151030201400.3017.89775@wrigleys.postgresql.org
Whole thread Raw
List pgsql-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;

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #13667: SSI violation...
Next
From: David Gould
Date:
Subject: Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower.