Re: [HACKERS] Problem with parser

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Problem with parser
Дата
Msg-id 199808141908.PAA20496@candle.pha.pa.us
обсуждение исходный текст
Ответ на Problem with parser  (jwieck@debis.com (Jan Wieck))
Список pgsql-hackers
> Hi,
>
>     who's the parser guru? I need help!
>
>     I have a table t1(a int4, b int4)
>
>     When I
>
>         update t1 set b = 2 where a = 1;
>
>     I get a targetlist with 1 entry and resno=2.
>
>     But when I
>
>         update t1 set b = t2.b where a = t2.a;
>
>     I  get the same 1 entry targetlist with resno=1 for attribute
>     "b".  That causes deep deep trouble in  the  rewrite  system,
>     when  fixing  the  expressions for *new* variable references.
>     *new*.attr defaults to *old*.attr except given in  the  query
>     to  be  updated.  When  fixing  *new* references, the rewrite
>     system looks up the original parsetree to find a TLE with the
>     same  resno as the attribute number in the *new*.attr.  So it
>     depends on having the resno same to the attno of  the  result
>     relation.
>
>     I'm  absolutely unfamiliar with the parser in this area and I
>     don't want to hack around and break things  so  close  before
>     6.4.  Who knows how to fix this?
>
>     BTW: up to now the rewrite system looks much better. It works
>     for insert, update and delete  when  using  constant  values.
>     insert ... select ... works too.

Let me take a look at this.  I am in the middle of a major patch, so it
may take a day or two.


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Problem with parser
Следующее
От: jwieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Problem with parser