Re: PREPARE code notes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PREPARE code notes
Date
Msg-id 11102.1031586668@sss.pgh.pa.us
Whole thread Raw
In response to PREPARE code notes  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: PREPARE code notes  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
Karel Zak <zakkr@zf.jcu.cz> writes:
>  1/ ExecuteQuery() (line 110). Why is needful use copyObject()? The
>     PostgreSQL executor modify query planns?

Yes, and yes.  Unfortunately.

>  2/ Lines 236 -- 245. Why do you "check for pre-existing entry of
>     same name" if you create hash table? I think better is use "else"
>     for this block of code and check it only if hash table already
>     exist.

The code reads more cleanly as-is; changing it as you suggest would
create an unnecessary interdependency between two logically distinct
concerns.
>  3/ Last is cosmetic: see line 404, what happen if memory context
>     is not valid? :-) (maybe use some elog() call)

Or just get rid of the MemoryContextIsValid test --- it shouldn't
ever not be valid.  Not very important though.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Script to compute randon page cost
Next
From: Tom Lane
Date:
Subject: Re: bug?