Postgres 11 procedures and result sets

From: Jan Kohnert <nospam001-lists(at)jan-kohnert(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Postgres 11 procedures and result sets
Date: 2018-10-01 21:53:54
Message-ID: 10467048.Hd5HFnr8GS@kohni-mobil
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello List,

I have a question regarding the new stored procedures in Postgres 11 (I tested
beta4):

I'd like to know if it is somehow possible to get a (or possibly more) result
set from selects within the SP, as it is possible in MariaDB, MySQL, or SQL
Server.

What I found until now is to use inout-Parms. Then I have to define all
columns in the select as inout-Params, but then I get only one line back,
regardless how many lines >0 have been selected.

I could also define an inout refcursor param, and parse that one, but that
would make the new SP identical to the well known functions returning a
refcursor. And when I use that approach, I have an additional step in Qt-Code
for example, since I have to exec the SP, then parse to the refcursor result,
exec the fetch and then parse the cursor output I'm interested in.

Did I miss something?

Thanks in advance!

--
MfG Jan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message derek 2018-10-01 22:20:49 Re: CREATE TABLE AS SELECT hangs
Previous Message Tom Lane 2018-10-01 21:29:19 Re: CREATE TABLE AS SELECT hangs