Re: Wrote a connect-by feature

From: Bertram Scharpf <lists(at)bertram-scharpf(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wrote a connect-by feature
Date: 2007-08-11 03:20:21
Message-ID: 20070811032021.GA27511@bart.bertram-scharpf.homelinux.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Am Donnerstag, 09. Aug 2007, 20:44:21 -0400 schrieb Andrew Dunstan:
> Bertram Scharpf wrote:
> >Am Mittwoch, 08. Aug 2007, 14:04:23 +0200 schrieb Bertram Scharpf:
> >>Am Mittwoch, 08. Aug 2007, 00:52:41 +0200 schrieb Bertram Scharpf:
> >>
> >>> <http://www.bertram-scharpf.de/tmp/connectby.tar.gz>
> >>>
> >
> >Nobody's answering just a line. Is it such a bore?
>
> Isn't connect by the Oracle non-standard way of doing recursive queries?
> Please review the mailing list archives on this subject.

I sure spent more time and effort on googling for
"recursive" and "hierarchical" than on writing it myself in
the end.

My solution has two features you probably will not find in
any Postgres or other SQL implementation.

- Inverse lookup. Instead of descending down the tassel
the path leading to the requested element is shown.

- A boolean field that indicates whether we have reached
the last element of a node. This is useful when drawing
a tree; you can give a ` instead of a | in front of the
key.

| Bart false
| Lisa false
` Maggie true

It takes almost no cost in time and memory.

> Also, many people have their heads down trying to punch out a release,
> right now.

Wouldn't the release be a good opportunity for providing
this little tool?

Thanks for your answers.

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2007-08-11 03:36:05 Re: Wrote a connect-by feature
Previous Message Tom Lane 2007-08-11 01:25:34 regexp_matches and regexp_split are inconsistent