To return a result set use SETOF, like so
CREATE FUNCTION test() RETURNS SETOF text AS '
To allow access to the tables only through a function, take a look at
declaring your functions with SECURITY DEFINER
CREATE FUNCTION test() RETURNS SETOF text SECURITY DEFINER AS '
.. Inside the function y
It sounds like you want a table function:
http://techdocs.postgresql.org/guides/SetReturningFunctions
On Wed, 21 Jul 2004, Gellert, Andre wrote:
> Hello,
> I have following problem:
>
> A user "xy" shouldn't have any rights to a table,
> but needs data from the content of the table.
> My idea
Hello,
I have following problem:
A user "xy" shouldn't have any rights to a table,
but needs data from the content of the table.
My idea was to setup a PL/PGSQL procedure to fetch the
data from the table, so that the user only is allowed to
access the procedure. I also tried using a SQL function