Re: cursors and function question

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: armand pirvu <armand(dot)pirvu(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: cursors and function question
Date: 2018-02-13 18:26:45
Message-ID: CAKFQuwaiygt-u=EgzwzSQwHAui_iyMYzWi_+nZSuTsmNhu99mA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday, February 13, 2018, armand pirvu <armand(dot)pirvu(at)gmail(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vikas Sharma 2018-02-13 18:53:41 Re: Multiple postmasters running from same directory
Previous Message armand pirvu 2018-02-13 18:22:19 cursors and function question