Received: from web21007.mail.yahoo.com (web21007.mail.yahoo.com [216.136.227.61]) by postgresql.org (Postfix) with SMTP id F0BDF47581D for ; Fri, 26 Jul 2002 09:51:59 -0400 (EDT) Message-ID: <20020726135204.20789.qmail@web21007.mail.yahoo.com> Received: from [193.68.232.20] by web21007.mail.yahoo.com via HTTP; Fri, 26 Jul 2002 06:52:04 PDT Date: Fri, 26 Jul 2002 06:52:04 -0700 (PDT) From: Heni Lolov Subject: PL/pgSQL To: pgsql-admin@postgresql.org In-Reply-To: <18728.1027611113@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200207/371 X-Sequence-Number: 5055 Hi there I have a problem that I can not solve. So is there any way to return a couple of rows from a PL/pgSQL function. I need this because I have to execute a query with undefined depth of subqueryes (not more than 10). The searched table represents a tree. And I have to find all sub branches og a given branch. here is the table: CREATE SEQUENCE grp_id_seq; CREATE TABLE grp ( id INT PRIMARY KEY NOT NULL DEFAULT nextval('grp_id_seq'), name VARCHAR NOT NULL, info VARCHAR, type_id INT DEFAULT NULL REFERENCES grp_types(id), mastergrp_id INT REFERENCES grp(id) ); I need it to use it in a query like this: SELECT foo FROM footable WHERE groups IN sub_grp(some_grp_id); Any idea how to make it? Thanks in advance! Hal __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com