Re: [HACKERS] Problem with parser

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: jwieck(at)debis(dot)com
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problem with parser
Date: 1998-08-14 19:06:50
Message-ID: 199808141908.PAA20496@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)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)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-08-14 19:26:06 Re: [HACKERS] Problem with parser
Previous Message Linda Chow 1998-08-14 18:54:12 access Postgre database through JDBC driver from Netscape FastTrack3.0.1 machine