Skip site navigation (1) Skip section navigation (2)

functionality like Oracle's "connect by"

From: "David Parker" <dparker(at)tazznetworks(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: functionality like Oracle's "connect by"
Date: 2004-08-30 20:52:32
Message-ID: 07FDEE0ED7455A48AC42AC2070EDFF7C049839@corpsrv2.tazznetworks.com (view raw or flat)
Thread:
Lists: pgsql-general
I know this question has been discussed, probably multiple times, but I
can't seem to access archives.postgresql.org today....

I need to select all the rows in a table with two fields: parent_id and
child_id that participate in the same logical "tree". In other words,
given an id value, I want to find where child_id = my-value, and then
retrieve the values in the tree above it.

The functionality I'm looking for is essentially the Oracle "connect
by". Does anything like this exist for postgresql? If not, does anybody
have a clever solution? (My not-so-clever first pass involved recursing
in my Java program, but the stack-space-abuse police are knocking on my
door....)

Again, apologies for asking something that's probably already been
discussed ad nauseum on this list...

-  DAP
====================================================== 
David Parker    Tazz Networks    (401) 709-5130
 

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2004-08-30 20:54:46
Subject: Re: aggregates with complex type as state and init condition
Previous:From: Thomas ChilleDate: 2004-08-30 19:20:14
Subject: aggregates with complex type as state and init condition

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group