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/readfuncs.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/readfuncs.c')
-rw-r--r-- | src/backend/nodes/readfuncs.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index cf2502c7151..7928c04de35 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.173 2004/08/29 04:12:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.174 2004/12/11 23:26:34 tgl Exp $ * * NOTES * Path and Plan nodes do not have any readfuncs support, because we @@ -576,6 +576,21 @@ _readRelabelType(void) } /* + * _readConvertRowtypeExpr + */ +static ConvertRowtypeExpr * +_readConvertRowtypeExpr(void) +{ + READ_LOCALS(ConvertRowtypeExpr); + + READ_NODE_FIELD(arg); + READ_OID_FIELD(resulttype); + READ_ENUM_FIELD(convertformat, CoercionForm); + + READ_DONE(); +} + +/* * _readCaseExpr */ static CaseExpr * @@ -971,6 +986,8 @@ parseNodeString(void) return_value = _readFieldStore(); else if (MATCH("RELABELTYPE", 11)) return_value = _readRelabelType(); + else if (MATCH("CONVERTROWTYPEEXPR", 18)) + return_value = _readConvertRowtypeExpr(); else if (MATCH("CASE", 4)) return_value = _readCaseExpr(); else if (MATCH("WHEN", 4)) |