Re: Recursive use

From: Adam Radlowski <adamr(at)informatyka(dot)gdansk(dot)pl>
To: Alexander Burbello <burbello3000(at)yahoo(dot)com(dot)br>
Cc: Lista Postgres <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Recursive use
Date: 2006-10-05 06:37:13
Message-ID: 4524A819.5020207@informatyka.gdansk.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I think it is not administration thing, but SQL language problem.
PostgreSQL is SQL92 compatible and has many very good and useful addons.
Generally, PostgreSQL gives You tools to analyze all, what You want,
when You hava data in tables.
You've explained in to short way You problem. The best is for example,
to give example project of tables, relations and their contents. Without
this I must build taht's all personally.
I suppose, You have to use construction:
select .... from (select ...) as foo;
or You can use views
or use cursor - first learn a little bit PLPGSQL language - it's very
simple and it is the best way; You can build with PLPGSQL the function,
what can return the result for You.
All about PosgreSQL SQL implementation and PGPLSQL You can find in
PostgreSQL doc's. I think it is very good written.

Greetings
Adam

Alexander Burbello wrote:

> Hi people,
>
> I need to know if Postgres do recursive search and how can I do!
> I will explain my problem.
>
>
> table COOPERATIVE
> code_cooperative int
> code_coo_father int
>
> I can have 3 level by business rules
>
> 1 - Father
> ----- 2 - Children
> --------- 3 - Grandchildren
>
>
> I would like to have a query asking who is father and granfather
> select grandfather, father from COOPERATIVE where COD_COOPERATIVE = 3
>
> Do the Postgres can solve this problem?
> Could anybody help me?
>
> Thank you
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Johnson 2006-10-05 16:24:11 Re: Disk space consumed by pk not returned after vacuum or reindex
Previous Message K Prakash 2006-10-05 04:48:08 Unsubscribe