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

From Atri Sharma
Subject Representing a SRF return column in catalogs
Date
Msg-id CAOeZVic5STWa=qoRTa4M2kmf8spjeFmARScA8oU6OpRR3a3Gyw@mail.gmail.com
Whole thread Raw
Responses Re: Representing a SRF return column in catalogs  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

I am working on something that requires representing a SRF return column in pg_proc and being able to retrieve it, retrieve the name of the column and make a ColumnRef node from it.

The catch here are aliases:

SELECT generate_series(1,100) AS a ORDER BY a;

I need to know that the return column of generate_series is being referred as a in this query (hence tlist, sortClause will have 'c').

I discussed and think that a way can be to have position of column rather than the actual name but that raises the question of the functionality needed for back resolving position to name (to make a ColumnRef node) and then infer that the column is being referred as an alias in this query.

Any pointers will be really helpful.

Regards,

Atri

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: WAL replay bugs
Next
From: Andrew Dunstan
Date:
Subject: Re: get_cast_func syscache utility function