Creating a Pseudocolumn - Mailing list pgsql-hackers

From Jonah H. Harris
Subject Creating a Pseudocolumn
Date
Msg-id 36e682920605150803l4e32ba18i68def954d0f56c27@mail.gmail.com
Whole thread Raw
Responses Re: Creating a Pseudocolumn
Re: Creating a Pseudocolumn
List pgsql-hackers
Hey everyone,

I'm reworking hierarchical queries and am adding a LEVEL pseudocolumn.As it's a totally calculated attribute, what's
thebest way to handle 
it keeping in mind that LEVEL is only used in a hierarchical query?

Looking at Evgen's patches, if he recognizes a hierarchical query and
finds a LEVEL column in the target list, he creates a FakeVar (similar
to Var) entry for it which is then passed throughout the system and
modified on a per-tuple basis.  While this works, it seems a bit
kludgy and requires a good amount of special-case code.  As such, I
was wondering if you guys have some suggestions on how to use what's
already there to accomplish the same thing.

I couldn't think of any pseudocolumns like this in PostgreSQL, but I
may just be brain-dead again.  As it may be sorta similar, how were we
discussing handling rownum?

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 2nd Floor            | jharris@enterprisedb.com
Iselin, New Jersey 08830            | http://www.enterprisedb.com/


pgsql-hackers by date:

Previous
From: "Hogan, James F. Jr."
Date:
Subject: Re: audit table containing Select statements submitted
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Creating a Pseudocolumn