pgsql: Instead of supposing (wrongly, in the general case) that the

Lists: pgsql-committers
From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Instead of supposing (wrongly, in the general case) that the
Date: 2004-12-11 23:26:54
Message-ID: 20041211232654.0FA4D3A644A@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
Instead of supposing (wrongly, in the general case) that the rowtype
of an inheritance child table is binary-compatible with the rowtype of
its parent, invent an expression node type that does the conversion
correctly. Fixes the new bug exhibited by Kris Shannon as well as a
lot of old bugs that would only show up when using multiple inheritance
or after altering the parent table.

Modified Files:
--------------
pgsql/src/backend/executor:
execQual.c (r1.169 -> r1.170)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execQual.c.diff?r1=1.169&r2=1.170)
pgsql/src/backend/nodes:
copyfuncs.c (r1.293 -> r1.294)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c.diff?r1=1.293&r2=1.294)
equalfuncs.c (r1.232 -> r1.233)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c.diff?r1=1.232&r2=1.233)
outfuncs.c (r1.243 -> r1.244)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c.diff?r1=1.243&r2=1.244)
readfuncs.c (r1.173 -> r1.174)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/readfuncs.c.diff?r1=1.173&r2=1.174)
pgsql/src/backend/optimizer/prep:
prepjointree.c (r1.23 -> r1.24)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c.diff?r1=1.23&r2=1.24)
prepunion.c (r1.117 -> r1.118)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c.diff?r1=1.117&r2=1.118)
pgsql/src/backend/optimizer/util:
clauses.c (r1.184 -> r1.185)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c.diff?r1=1.184&r2=1.185)
pgsql/src/backend/parser:
parse_coerce.c (r2.124 -> r2.125)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_coerce.c.diff?r1=2.124&r2=2.125)
parse_expr.c (r1.176 -> r1.177)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_expr.c.diff?r1=1.176&r2=1.177)
pgsql/src/backend/utils/adt:
ruleutils.c (r1.185 -> r1.186)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c.diff?r1=1.185&r2=1.186)
pgsql/src/include/nodes:
execnodes.h (r1.120 -> r1.121)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h.diff?r1=1.120&r2=1.121)
nodes.h (r1.161 -> r1.162)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/nodes.h.diff?r1=1.161&r2=1.162)
primnodes.h (r1.104 -> r1.105)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/primnodes.h.diff?r1=1.104&r2=1.105)
pgsql/src/pl/plpgsql/src:
pl_exec.c (r1.123 -> r1.124)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/pl_exec.c.diff?r1=1.123&r2=1.124)


From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Instead of supposing (wrongly, in the general
Date: 2004-12-12 07:11:35
Message-ID: 41BBEF27.9050308@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Tom Lane wrote:
> Instead of supposing (wrongly, in the general case) that the rowtype
> of an inheritance child table is binary-compatible with the rowtype of
> its parent, invent an expression node type that does the conversion
> correctly. Fixes the new bug exhibited by Kris Shannon as well as a
> lot of old bugs that would only show up when using multiple inheritance
> or after altering the parent table.

Attached is a patch adding regression tests for this change. I'll apply
it to HEAD later tonight or tomorrow baring any objections. I just used
the two test cases posted in the -hackers thread; Tom, if you have any
other test cases for this behavior in mind, just let me know.

-Neil

Attachment Content-Type Size
inh_rowtype_cast_test-1.patch text/x-patch 1.8 KB

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Instead of supposing (wrongly, in the
Date: 2004-12-12 22:49:33
Message-ID: 1102891773.23208.0.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

On Sun, 2004-12-12 at 18:11 +1100, Neil Conway wrote:
> Attached is a patch adding regression tests for this change.

Applied.

-Neil