Function returning multiple rows?

From: Patrik Kudo <kudo(at)partitur(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: Function returning multiple rows?
Date: 1999-02-05 15:54:10
Message-ID: 36BB1422.E9C4FF0E@partitur.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I've been trying to create a function which returns multiple rows, but I
can't get it working. I'm I doing something wrong, or is it not
possible? This is my setup:

create table groups (userid int4, grp int4);

CREATE FUNCTION usersingroup(int4) RETURNS int4 AS 'SELECT userid FROM
groups WHERE grp = $1;' LANGUAGE 'sql';

When doing a

SELECT usersingroup(100);

I only get the first row. Is there any way to get all the rows?

Regards,
Patrik Kudo
kudo(at)partitur(dot)se

Browse pgsql-sql by date

  From Date Subject
Next Message Juris 1999-02-05 16:00:01 performance problems of a complex query with 2 subselects
Previous Message Patrik Kudo 1999-02-05 15:48:44 function returning multiple rows?