diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-12-11 23:26:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-12-11 23:26:51 +0000 |
commit | 12b1b5d837b5ce1c07ee3535e74e4cc3039063d6 (patch) | |
tree | 1ef0ecc2ccfba9a8a33f0b20ef31533b499cbdba /src/backend/nodes/outfuncs.c | |
parent | fd536dd257b12a8b1abf8d744d8a3688e1db126b (diff) | |
download | postgresql-12b1b5d837b5ce1c07ee3535e74e4cc3039063d6.tar.gz postgresql-12b1b5d837b5ce1c07ee3535e74e4cc3039063d6.zip |
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.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index b80cee4944c..292b608c22f 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.243 2004/08/29 05:06:43 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.244 2004/12/11 23:26:33 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -768,6 +768,16 @@ _outRelabelType(StringInfo str, RelabelType *node) } static void +_outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node) +{ + WRITE_NODE_TYPE("CONVERTROWTYPEEXPR"); + + WRITE_NODE_FIELD(arg); + WRITE_OID_FIELD(resulttype); + WRITE_ENUM_FIELD(convertformat, CoercionForm); +} + +static void _outCaseExpr(StringInfo str, CaseExpr *node) { WRITE_NODE_TYPE("CASE"); @@ -1728,6 +1738,9 @@ _outNode(StringInfo str, void *obj) case T_RelabelType: _outRelabelType(str, obj); break; + case T_ConvertRowtypeExpr: + _outConvertRowtypeExpr(str, obj); + break; case T_CaseExpr: _outCaseExpr(str, obj); break; |