From: Heni Lolov <hal_bg@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: PL/pgSQL
Date: Fri, 26 Jul 2002 06:52:04 -0700 (PDT)
Message-ID: <20020726135204.20789.qmail@web21007.mail.yahoo.com> (raw)
In-Reply-To: <18728.1027611113@sss.pgh.pa.us>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: hal_bg@yahoo.com
Subject: Re: PL/pgSQL
In-Reply-To: <20020726135204.20789.qmail@web21007.mail.yahoo.com>
References: <18728.1027611113@sss.pgh.pa.us> <20020726135204.20789.qmail@web21007.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox