Good analysis. Thanks. Pavlov, I know this code is complex. I think
these tips will help.
---------------------------------------------------------------------------
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Double-oops. There is a later one under a different email subject
> > called TODO questino that is a context diff. I just need to know if
> > this is the newest version and if anyone doesn't like it.
>
> I don't like it. As given, it inserts default values into the query
> at parse time, whereas this must not be done until planning time.
> (Otherwise the defaults sneak into stored rules, and if you change
> defaults with ALTER TABLE you will get unexpected results.) The
> correct (and actually easier) way is to simply drop the defaulted column
> out of the analyzed query altogether.
>
> This is not Pavlo's fault exactly, since he copied the way we used
> to do it in 7.1 ... but the patch must be updated to follow 7.2
> practice.
>
> Another problem: no copy/equal/outfuncs support for the added node type.
>
> Stylistic issue: we should discourage people from putting their initials
> on every bit of code they touch. The code will soon be unreadable if
> such becomes common practice.
>
> regards, tom lane
>
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026