mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +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:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.293 2004/11/05 19:15:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.294 2004/12/11 23:26:33 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -876,6 +876,21 @@ _copyRelabelType(RelabelType *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyConvertRowtypeExpr
|
||||
*/
|
||||
static ConvertRowtypeExpr *
|
||||
_copyConvertRowtypeExpr(ConvertRowtypeExpr *from)
|
||||
{
|
||||
ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr);
|
||||
|
||||
COPY_NODE_FIELD(arg);
|
||||
COPY_SCALAR_FIELD(resulttype);
|
||||
COPY_SCALAR_FIELD(convertformat);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyCaseExpr
|
||||
*/
|
||||
@ -2696,6 +2711,9 @@ copyObject(void *from)
|
||||
case T_RelabelType:
|
||||
retval = _copyRelabelType(from);
|
||||
break;
|
||||
case T_ConvertRowtypeExpr:
|
||||
retval = _copyConvertRowtypeExpr(from);
|
||||
break;
|
||||
case T_CaseExpr:
|
||||
retval = _copyCaseExpr(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user