Re: Call Function from within Function - parent / dispatch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stefan Zauchenberger <stefan(at)ice-sys(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Call Function from within Function - parent / dispatch
Date: 2018-08-23 14:22:32
Message-ID: 16790.1535034152@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Stefan Zauchenberger <stefan(at)ice-sys(dot)com> writes:
> I am having a problem creating a parent function that calls different functions within based on conditions. The functions within all take the exact same arguments and return the same set type. This must be a simple mistake on my part, but not sure of the fix.

If you're trying to pass a set result back up, the easiest way is to
use "RETURN QUERY SELECT * FROM child_function(...)". Plain "RETURN"
only works for scalar results, and RETURN NEXT is for producing a
result-set one row at a time.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mark Williams 2018-08-23 16:53:55 RE: Setting up SSL for postgre
Previous Message Stefan Zauchenberger 2018-08-23 13:52:17 Call Function from within Function - parent / dispatch