Creating unique or "internal-use-only" column names (ColumnRef)

Поиск
Список
Период
Сортировка
От Peter Moser
Тема Creating unique or "internal-use-only" column names (ColumnRef)
Дата
Msg-id 55ED7B3C.9000404@gmail.com
обсуждение исходный текст
Ответы Re: Creating unique or "internal-use-only" column names (ColumnRef)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Good afternoon,
is it possible to create unique column names or to give column names 
inside the parser phase that do not interfer with the outside world, 
i.e. with column names from tables or aliases given by the user.

Some short background:
I created my own from-clause-item, that gets rewritten into a sub-query. 
I do this because I want to re-use existing code as much as possible. 
The rewritten sub-query gets transformed with "transformRangeSubselect"...
Within this sub-query I need 3 columns that shouldn't interfer with 
columns from the input. We refer to them from a JOIN-ON clause and an 
ORDER-BY clause.

Example code:

ColumnRef     *ref;
ref = makeNode(ColumnRef);
ref->fields = list_make1(makeString("some_unique_name"));
ref->location = -1; /* Unknown location */

...

sb1 = makeNode(SortBy);
sb1->node = ref;

...

ssResult = makeNode(SelectStmt);
ssResult->withClause = NULL;
ssResult->fromClause = list_make1(joinExpr);
ssResult->targetList = list_make1(rtAStarWithR);  /* input = r.* */
ssResult->sortClause = list_make2(sb1, sb2);

Is there a possibility for such column names?

Thanks for your help,
Peter




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Fwd: [Snowball-discuss] New website
Следующее
От: Greg Stark
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Move DTK_ISODOW DTK_DOW and DTK_DOY to be type UNITS rather than