Skip site navigation (1) Skip section navigation (2)

Re: Create a function that creates a function which returns a table and return that table in one step

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rainer Schuetz <rs(at)bagong(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Create a function that creates a function which returns a table and return that table in one step
Date: 2008-11-21 17:18:40
Message-ID: 7350.1227287920@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Rainer Schuetz <rs(at)bagong(dot)de> writes:
> I have a function (the 'outer' function) that creates another function  
> which runs a select-query on a table. This table is specified by a  
> parameter I use when running the outer function (there are many  
> tables, on which the query could be executed and I would like to  
> prevent having to write my function for each of them).

Introducing the extra function seems to be just complicating your life.
Why don't you just EXECUTE the desired SELECT directly from the main
function?

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Bruce HyattDate: 2008-11-22 01:54:58
Subject: Roles
Previous:From: Rainer SchuetzDate: 2008-11-21 16:53:52
Subject: Create a function that creates a function which returns a table and return that table in one step

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group