Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B3C6C9FB1C2 for ; Wed, 4 Oct 2006 10:15:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 00718-01 for ; Wed, 4 Oct 2006 10:14:54 -0300 (ADT) X-Greylist: delayed 00:06:39.448697 by SQLgrey- Received: from mail.cresoltec.com.br (unknown [200.103.143.8]) by postgresql.org (Postfix) with SMTP id 1AE0F9FB1BD for ; Wed, 4 Oct 2006 10:14:52 -0300 (ADT) Received: (qmail 25722 invoked from network); 4 Oct 2006 13:09:03 -0000 Received: from unknown (HELO ?10.90.2.162?) (10.90.2.162) by mail.cresoltec.com.br with SMTP; 4 Oct 2006 13:09:03 -0000 Message-ID: <4523B23A.3000506@yahoo.com.br> Date: Wed, 04 Oct 2006 10:08:10 -0300 From: Alexander Burbello User-Agent: Mozilla Thunderbird 1.0.2 (X11/20060423) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Lista Postgres Subject: Recursive use Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.014 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: * X-Archive-Number: 200610/22 X-Sequence-Number: 23325 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