Re: Creating a Pseudocolumn - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: Creating a Pseudocolumn
Date
Msg-id 65937bea0605160248r6ddc8064q572f4268e9f571f8@mail.gmail.com
Whole thread Raw
In response to Re: Creating a Pseudocolumn  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Creating a Pseudocolumn
List 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@sss.pgh.pa.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.
>


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [BUGS] BUG #2429: Explain does not report object's schema
Next
From: "Pavel Stehule"
Date:
Subject: Wrong plan for simple join with index on FK