Re: cursors and function question - Mailing list pgsql-general

From David G. Johnston
Subject Re: cursors and function question
Date
Msg-id CAKFQuwaiygt-u=EgzwzSQwHAui_iyMYzWi_+nZSuTsmNhu99mA@mail.gmail.com
Whole thread Raw
In response to cursors and function question  (armand pirvu <armand.pirvu@gmail.com>)
Responses Re: cursors and function question  (armand pirvu <armand.pirvu@gmail.com>)
List pgsql-general
On Tuesday, February 13, 2018, armand pirvu <armand.pirvu@gmail.com> wrote:

CREATE OR REPLACE FUNCTION foofunc()
   RETURNS text AS $$

select foofunc();
            foofunc
-------------------------------
 ("E1        ","CAT1      ",0)

But I am looking to get

            foofunc
-------------------------------
 ("E1        ","CAT1      ",0)
 ("E1        ","CATs      ",0)


You need to specify SETOF

CREATE FUNCTION foofunc() RETURNS SETOF text AS

David J.

pgsql-general by date:

Previous
From: armand pirvu
Date:
Subject: cursors and function question
Next
From: Vikas Sharma
Date:
Subject: Re: Multiple postmasters running from same directory