Re: Creating a Pseudocolumn

From: "Gurjeet Singh" <singh(dot)gurjeet(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Creating a Pseudocolumn
Date: 2006-05-16 09:48:19
Message-ID: 65937bea0605160248r6ddc8064q572f4268e9f571f8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think Jonah is referring to the the 'START WITH ... CONNECT BY'
clause feature from Oracle. Am I right Jonah?

For such queries, Oracle introduces a pseudocolumn LEVEL, that
holds the value of the indentation level of the current rusultant row.
In Oracle, the LEVEL column returns 0 for the root node of a
hierarchy, 1 for it's children, 2 for their children, and so forth.
LEVEL is commonly used to indent hierarchical results.

LEVEL might not be a part of the standard, but it is very handy
when dealing with hierarchical queries.

The chapter 1 (http://www.oreilly.com/catalog/sqlpr/chapter/ch01.pdf)
of book 'SQL Pocket Guide' elaborates more on it.

Gurjeet.

On 5/16/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Perhaps you should start by explaining what the heck you're talking
> about ;-). I can find nothing in the SQL2003 spec that sounds anything
> like a LEVEL function or pseudocolumn.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2006-05-16 09:52:05 Wrong plan for simple join with index on FK
Previous Message winlinchu 2006-05-16 09:25:45 Help!!!!