Re: Changing a relation's name in parser stage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Changing a relation's name in parser stage
Дата
Msg-id 20155.1084232605@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Changing a relation's name in parser stage  ("Matthias Lenz" <ml134883@inf.tu-dresden.de>)
Список pgsql-novice
"Matthias Lenz" <ml134883@inf.tu-dresden.de> writes:
> List *i;
> i=nth(1, stmt->fromClause);
> ((RangeVar *) lfirst(i))->relname = "s_overall";

nth() is going to give you a list element, not a List*.  So you don't
want the lfirst() call.  I'm also dubious about whether you didn't mean
nth(0, stmt->fromClause) --- nth() counts from zero not one.  Finally,
it seems extremely fragile to assume that fromClause entries are
necessarily RangeVars without checking.  There are other node types that
could be there.

            regards, tom lane

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

Предыдущее
От: David Cruz
Дата:
Сообщение: Question about REF / DREF
Следующее
От: Ian Pilcher
Дата:
Сообщение: Darn pop singers!