Re: WITH RECURSIVE patch V0.1

Kev <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.patches
Organization http://groups.google.com
Message-ID <[email protected]>
On May 19, 1:17 am, [email protected] (David Fetter) wrote:
> On Mon, May 19, 2008 at 12:21:20AM -0400, Gregory Stark wrote:
> > It's quite possible to have clauses which will limit the output but
> > not in a way the database can determine.  Consider for example a
> > tree-traversal for a binary tree stored in a recursive table
> > reference.  The DBA might know that the data contains no loops but
> > the database doesn't.
>
> I seem to recall Oracle's implementation can do this traversal on
> write operations, but maybe that's just their marketing.

That's how I implement (id, name, parent)-trees as a DBA, having an
insert/update trigger function check_no_loops(), but I'm not sure that
it would be faster than the hash method suggested by Hannu Krosing.  I
guess it depends on whether you're inserting/updating or selecting
more.  Does it make sense to leave the option to the user, whether to
check for infinite recursion just in time or not?

Kev

-- 
Sent via pgsql-patches mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.