Re: Representing a SRF return column in catalogs - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Representing a SRF return column in catalogs
Date
Msg-id CA+TgmobtT-a7vp7bghwDViVA6LVGOtvxnYPL=zu1ro-FCRxcmg@mail.gmail.com
Whole thread Raw
In response to Re: Representing a SRF return column in catalogs  (Atri Sharma <atri.jiit@gmail.com>)
Responses Re: Representing a SRF return column in catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Nov 7, 2014 at 11:31 AM, Atri Sharma <atri.jiit@gmail.com> wrote:
> Let me give an example:
>
> Consider an user defined SRF (or an inbuilt one (generate_series)). I am
> working on a path keys tracking project (more details on it in a separate
> email). I am interested in one of the columns of the result of the SRF and
> want to store it in catalogs in a manner that allows me to refer it later
> when executing the SRF.
>
> One way can be to store the raw column name. However, I am not sure how will
> that work around aliases without a considerable fiddling with Alias nodes in
> parsetime.
>
> Can I store relattnos or something? I need to get the stored att in planner
> and build pathkeys from it.

I still can't really follow.  The columns returned by an SRF can't
change after the function is created, so the column number ought to be
stable.  The name probably will be too, though.  On the other hand,
either could get dropped and created, so then where are you?  I don't
know, because I still can't understand what you're trying to do.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: row_to_json bug with index only scans: empty keys!
Next
From: Robert Haas
Date:
Subject: Re: On partitioning