1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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.
This commit is contained in:
Tom Lane
2004-12-11 23:26:51 +00:00
parent fd536dd257
commit 12b1b5d837
15 changed files with 356 additions and 71 deletions

View File

@ -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*
@ -767,6 +767,16 @@ _outRelabelType(StringInfo str, RelabelType *node)
WRITE_ENUM_FIELD(relabelformat, CoercionForm);
}
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)
{
@ -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;