Re: [HACKERS] Almost there on column aliases

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Almost there on column aliases
Дата
Msg-id 11110.950603587@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCHES] Re: [HACKERS] Almost there on column aliases  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> I probably misdiagnosed the behavior, but in any case I'd be *really*
> happy if someone wants to put me out of my misery on this one ;)

At least some of your problems are due to confusing list nodes with the
nodes they point to, as in this example from parse_clause.c:

List *
ListTableAsAttrs(ParseState *pstate, char *table);
List *
ListTableAsAttrs(ParseState *pstate, char *table)
{List *rlist = NULL;List *col;
Attr *attr = expandTable(pstate, table, TRUE);foreach(col, attr->attrs){    Attr *a;    a = makeAttr(table,
strVal((Value*) col));    rlist = lappend(rlist, a);}
 
return rlist;
}

I tried, but failed, to refrain from remarking about the horrible
style of the function declaration --- either it's static (which
looks like the right answer here) or it should be declared in
a header file.  The above method of preventing gcc from telling
you how horrible your style is is just, well, never mind.

The more immediate problem is that you want
    a = makeAttr(table, strVal((Value *) lfirst(col)));

I cleaned up a similar error in ruleutils.c, but am too tired to
fix this one or go digging for more.
        regards, tom lane


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

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: [HACKERS] Solution for LIMIT cost estimation
Следующее
От: "Kardos, Dr. Andreas"
Дата:
Сообщение: Re: [HACKERS] README.qnx4 -> FAQ_QNX4