Postgres 11 procedures and result sets - Mailing list pgsql-general

From Jan Kohnert
Subject Postgres 11 procedures and result sets
Date
Msg-id 10467048.Hd5HFnr8GS@kohni-mobil
Whole thread Raw
Responses Re: Postgres 11 procedures and result sets  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE TABLE AS SELECT hangs
Next
From: derek
Date:
Subject: Re: CREATE TABLE AS SELECT hangs