Re: How to return multiple rows by stored procedure in postgresql - Mailing list pgsql-admin

From Paul Förster
Subject Re: How to return multiple rows by stored procedure in postgresql
Date
Msg-id 39B3366A-5C16-4477-9C5C-03D3689179CB@gmail.com
Whole thread Raw
In response to Re: How to return multiple rows by stored procedure in postgresql  (Naveen Kumar <naveenmcp@gmail.com>)
Responses Re: How to return multiple rows by stored procedure in postgresql  (Holger Jakobs <holger@jakobs.com>)
List pgsql-admin
Hi Naveen,

> On 06. Oct, 2020, at 08:15, Naveen Kumar <naveenmcp@gmail.com> wrote:
>
> Thank you for the quick response.
>
> All the examples are talking about functions, not about procedures in PostgreSQL. what i am looking for is how to
returnmultiple rows by calling STORED PROCEDURE in postgreSQL 12 version. 
>
> Thank you
> Naveen

a procedure does by definition not return anything. If you want to return something, use a function.

As for returning multiple rows, use create function ... returns table (columns...)

https://www.postgresql.org/docs/current/sql-createfunction.html
https://www.postgresql.org/docs/current/sql-createprocedure.html

Cheers,
Paul


pgsql-admin by date:

Previous
From: Naveen Kumar
Date:
Subject: How to add partitions to the existing table in PostgreSQL
Next
From: Nagaraj Raj
Date:
Subject: Re: How to add partitions to the existing table in PostgreSQL