mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Fix up the remaining places where the expression node structure would lose
available information about the typmod of an expression; namely, Const, ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks. In the ArrayExpr and SubLink cases it wasn't really the data structure's fault, but exprTypmod() being lazy. This seems like a good idea in view of the expected increase in typmod usage from Teodor's work to allow user-defined types to have typmods. In particular this responds to the concerns we had about eliminating the special-purpose hack that exprTypmod() used to have for BPCHAR Consts. We can now tell whether or not such a Const has been cast to a specific length, and report or display properly if so. initdb forced due to changes in stored rules.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.301 2007/03/13 00:33:40 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.302 2007/03/17 00:11:03 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -139,6 +139,7 @@ static bool
|
||||
_equalConst(Const *a, Const *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(consttype);
|
||||
COMPARE_SCALAR_FIELD(consttypmod);
|
||||
COMPARE_SCALAR_FIELD(constlen);
|
||||
COMPARE_SCALAR_FIELD(constisnull);
|
||||
COMPARE_SCALAR_FIELD(constbyval);
|
||||
@@ -180,9 +181,9 @@ _equalAggref(Aggref *a, Aggref *b)
|
||||
static bool
|
||||
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(refrestype);
|
||||
COMPARE_SCALAR_FIELD(refarraytype);
|
||||
COMPARE_SCALAR_FIELD(refelemtype);
|
||||
COMPARE_SCALAR_FIELD(reftypmod);
|
||||
COMPARE_NODE_FIELD(refupperindexpr);
|
||||
COMPARE_NODE_FIELD(reflowerindexpr);
|
||||
COMPARE_NODE_FIELD(refexpr);
|
||||
|
||||
Reference in New Issue
Block a user