Re: [HACKERS] Arrays broken on temp tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Arrays broken on temp tables
Date
Msg-id 13629.942294596@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Arrays broken on temp tables  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Arrays broken on temp tables  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> There is more than one way we could attack this, but I think the
>> cleanest answer will be to make it possible to extract a logical
>> table name from a relcache entry.

> Well, as I remember, the good news is that our code was fine, and the
> original poster just missed the WHERE clause on the update.  So I guess
> that gets us off the hook for a while.
> However, now looking at the posting again:
>     http://www.postgresql.org/mhonarc/pgsql-hackers/1999-11/msg00213.html
> I am confused again.

No, our code is *not* OK.  It's true that the original example was given
without a WHERE clause, whereas a practical UPDATE would usually have a
WHERE clause; but that has nothing to do with whether the planner will
generate a join or not.  If a join is done then the wrong things will
happen, WHERE or no WHERE.

The bottom line here is that we mustn't generate separate RTEs for the
logical and physical table names.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] What is nameout() for?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Arrays broken on temp tables