Re: DAGs and recursive queries

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "paul(dot)dorman" <paul(dot)dorman(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: DAGs and recursive queries
Date: 2007-09-27 18:31:17
Message-ID: 1190917877.5943.111.camel@dogma.ljc.laika.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2007-09-26 at 16:54 +0100, Gregory Stark wrote:
> "paul.dorman" <paul(dot)dorman(at)gmail(dot)com> writes:
>
> > Hi everyone,
> >
> > I would like to know the best way to implement a DAG in PostgreSQL. I
> > understand there has been some talk of recursive queries, and I'm
> > wondering if there has been much progress on this.
>
> The ANSI recursive queries didn't make it into 8.3. I still hope it makes 8.4.
>
> You could check out the tablefunc contrib which includes a function called
> connectby() which implements a kind of recursive query.
>
> Alternatively you might look at the ltree contrib module but that doesn't work
> the way you describe. It denormalizes the data for very fast but less flexible

Ltree seems like it might be a good option for him. What doesn't it do
that he needs?

I am also interested in graphs and trees in relational databases. Can
you recommend any good books? I particularly like CJ Date as an author,
but I can't find anything by him that specifically addresses this topic.

Also, how exactly is the database denormalized by using ltree?

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Smith 2007-09-27 18:48:00 Re: access privileges: grant select on (all current and future tables)?
Previous Message Scott Marlowe 2007-09-27 15:13:58 Re: Find "smallest common year"