function to return query result - Mailing list pgsql-general

From Peter Maas
Subject function to return query result
Date
Msg-id 3A24E9BB.BB91947A@mrinfo.de
Whole thread Raw
Responses Re: function to return query result  (Ashley Clark <aclark@ghoti.org>)
List pgsql-general
Hi,

this is the first time for me to post into this mailing list so
let me introduce myself: I'm working at a little software company
in Germany. We run a mixed Linux/Windows network. The workhorse is
a Linux Server running named, apache, samba and last not least a
PostgresQL 7.0.2 service.

Now my question: I tried to write a PL/PGSQL function that returns
a query result:

CREATE FUNCTION pms() RETURNS pmsummen AS '
declare
    result pmsummen;
BEGIN
    select into result * from pmsummen;
    return result;
END;
' LANGUAGE 'plpgsql';

SELECT pms(); yields the error
NOTICE:  plpgsql: ERROR during compile of pms near line 2
ERROR:  parse error at or near "pmsummen"

I tried lots of variations of this function (employing PERFORM,
replacing pmsummen by record, ...) but everything failed. My
first intention was to write a parameterized view but this
doesn't seem to exist in PostgresQL so I tried to write a
function returning a query result. Thanks for your help.

Peter.

PS: Are there any pgsql newsgroups? Has muc.lists.postgres.
question something in common with this mailing list?

Peter.

--
------------------------------------------------------------------
Peter Maas, m+r infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-875094 Fax +49-241-875095 eMail pm@mrinfo.de
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Stefano Bargioni
Date:
Subject: Sorting with relevant blank spaces
Next
From: Mart Käsper
Date:
Subject: Retrieving arrays through JDBC