Re: Representing a SRF return column in catalogs

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Representing a SRF return column in catalogs
Date: 2014-11-07 20:32:26
Message-ID: CA+TgmobtT-a7vp7bghwDViVA6LVGOtvxnYPL=zu1ro-FCRxcmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 7, 2014 at 11:31 AM, Atri Sharma <atri(dot)jiit(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-11-07 20:40:37 Re: On partitioning
Previous Message Andrew Dunstan 2014-11-07 20:15:48 Re: row_to_json bug with index only scans: empty keys!