1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* equalfuncs.c
|
2000-06-29 09:35:57 +02:00
|
|
|
* Equality functions to compare node trees.
|
|
|
|
*
|
2002-12-05 16:50:39 +01:00
|
|
|
* NOTE: we currently support comparing all node types found in parse
|
|
|
|
* trees. We do not support comparing executor state trees; there
|
|
|
|
* is no need for that, and no point in maintaining all the code that
|
|
|
|
* would be needed. We also do not support comparing Path trees, mainly
|
|
|
|
* because the circular linkages between RelOptInfo and Path nodes can't
|
|
|
|
* be handled easily in a simple depth-first traversal.
|
2000-06-29 09:35:57 +02:00
|
|
|
*
|
2002-12-05 16:50:39 +01:00
|
|
|
* Currently, in fact, equal() doesn't know how to compare Plan trees
|
2003-08-04 02:43:34 +02:00
|
|
|
* either. This might need to be fixed someday.
|
2000-06-29 09:35:57 +02:00
|
|
|
*
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2007-01-05 23:20:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
* IDENTIFICATION
|
2007-11-15 23:25:18 +01:00
|
|
|
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.315 2007/11/15 22:25:15 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-01-10 21:19:49 +01:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
#include "postgres.h"
|
|
|
|
|
1999-07-16 07:00:38 +02:00
|
|
|
#include "nodes/relation.h"
|
1996-07-09 08:22:35 +02:00
|
|
|
#include "utils/datum.h"
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
/*
|
2003-08-04 02:43:34 +02:00
|
|
|
* Macros to simplify comparison of different kinds of fields. Use these
|
|
|
|
* wherever possible to reduce the chance for silly typos. Note that these
|
2002-11-25 04:33:27 +01:00
|
|
|
* hard-wire the convention that the local variables in an Equal routine are
|
|
|
|
* named 'a' and 'b'.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Compare a simple scalar field (int, float, bool, enum, etc) */
|
|
|
|
#define COMPARE_SCALAR_FIELD(fldname) \
|
|
|
|
do { \
|
|
|
|
if (a->fldname != b->fldname) \
|
|
|
|
return false; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
/* Compare a field that is a pointer to some kind of Node or Node tree */
|
|
|
|
#define COMPARE_NODE_FIELD(fldname) \
|
|
|
|
do { \
|
|
|
|
if (!equal(a->fldname, b->fldname)) \
|
|
|
|
return false; \
|
|
|
|
} while (0)
|
|
|
|
|
2003-02-08 21:20:55 +01:00
|
|
|
/* Compare a field that is a pointer to a Bitmapset */
|
|
|
|
#define COMPARE_BITMAPSET_FIELD(fldname) \
|
|
|
|
do { \
|
|
|
|
if (!bms_equal(a->fldname, b->fldname)) \
|
|
|
|
return false; \
|
|
|
|
} while (0)
|
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
/* Compare a field that is a pointer to a C string, or perhaps NULL */
|
|
|
|
#define COMPARE_STRING_FIELD(fldname) \
|
|
|
|
do { \
|
|
|
|
if (!equalstr(a->fldname, b->fldname)) \
|
|
|
|
return false; \
|
|
|
|
} while (0)
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
/* Macro for comparing string fields that might be NULL */
|
2001-03-22 05:01:46 +01:00
|
|
|
#define equalstr(a, b) \
|
2000-08-12 01:45:35 +02:00
|
|
|
(((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
|
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
/* Compare a field that is a pointer to a simple palloc'd object of size sz */
|
|
|
|
#define COMPARE_POINTER_FIELD(fldname, sz) \
|
|
|
|
do { \
|
|
|
|
if (memcmp(a->fldname, b->fldname, (sz)) != 0) \
|
|
|
|
return false; \
|
|
|
|
} while (0)
|
|
|
|
|
1999-07-29 04:45:36 +02:00
|
|
|
|
1996-07-09 08:22:35 +02:00
|
|
|
/*
|
1997-09-07 07:04:48 +02:00
|
|
|
* Stuff from primnodes.h
|
1996-07-09 08:22:35 +02:00
|
|
|
*/
|
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
static bool
|
|
|
|
_equalAlias(Alias *a, Alias *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(aliasname);
|
|
|
|
COMPARE_NODE_FIELD(colnames);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalRangeVar(RangeVar *a, RangeVar *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(catalogname);
|
|
|
|
COMPARE_STRING_FIELD(schemaname);
|
|
|
|
COMPARE_STRING_FIELD(relname);
|
|
|
|
COMPARE_SCALAR_FIELD(inhOpt);
|
|
|
|
COMPARE_SCALAR_FIELD(istemp);
|
|
|
|
COMPARE_NODE_FIELD(alias);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1998-09-01 05:29:17 +02:00
|
|
|
return true;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
2007-02-20 18:32:18 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalIntoClause(IntoClause *a, IntoClause *b)
|
2007-02-20 18:32:18 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(rel);
|
|
|
|
COMPARE_NODE_FIELD(colNames);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
|
|
|
COMPARE_SCALAR_FIELD(onCommit);
|
|
|
|
COMPARE_STRING_FIELD(tableSpaceName);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
/*
|
|
|
|
* We don't need an _equalExpr because Expr is an abstract supertype which
|
2003-08-04 02:43:34 +02:00
|
|
|
* should never actually get instantiated. Also, since it has no common
|
2002-12-12 16:49:42 +01:00
|
|
|
* fields except NodeTag, there's no need for a helper routine to factor
|
|
|
|
* out comparing the common fields...
|
|
|
|
*/
|
1996-07-09 08:22:35 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
1997-09-08 23:56:23 +02:00
|
|
|
_equalVar(Var *a, Var *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(varno);
|
|
|
|
COMPARE_SCALAR_FIELD(varattno);
|
|
|
|
COMPARE_SCALAR_FIELD(vartype);
|
|
|
|
COMPARE_SCALAR_FIELD(vartypmod);
|
|
|
|
COMPARE_SCALAR_FIELD(varlevelsup);
|
|
|
|
COMPARE_SCALAR_FIELD(varnoold);
|
|
|
|
COMPARE_SCALAR_FIELD(varoattno);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1998-09-01 05:29:17 +02:00
|
|
|
return true;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
1997-09-08 23:56:23 +02:00
|
|
|
_equalConst(Const *a, Const *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(consttype);
|
2007-03-17 01:11:05 +01:00
|
|
|
COMPARE_SCALAR_FIELD(consttypmod);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(constlen);
|
|
|
|
COMPARE_SCALAR_FIELD(constisnull);
|
|
|
|
COMPARE_SCALAR_FIELD(constbyval);
|
2000-04-12 19:17:23 +02:00
|
|
|
|
1999-12-24 07:43:34 +01:00
|
|
|
/*
|
2000-04-12 19:17:23 +02:00
|
|
|
* We treat all NULL constants of the same type as equal. Someday this
|
2005-10-15 04:49:52 +02:00
|
|
|
* might need to change? But datumIsEqual doesn't work on nulls, so...
|
1999-12-24 07:43:34 +01:00
|
|
|
*/
|
|
|
|
if (a->constisnull)
|
|
|
|
return true;
|
2000-07-12 04:37:39 +02:00
|
|
|
return datumIsEqual(a->constvalue, b->constvalue,
|
|
|
|
a->constbyval, a->constlen);
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
1997-09-08 23:56:23 +02:00
|
|
|
_equalParam(Param *a, Param *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(paramkind);
|
2006-04-22 03:26:01 +02:00
|
|
|
COMPARE_SCALAR_FIELD(paramid);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(paramtype);
|
2006-12-10 23:13:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(paramtypmod);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
1998-09-01 05:29:17 +02:00
|
|
|
return true;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
1999-07-29 04:45:36 +02:00
|
|
|
static bool
|
2002-12-12 16:49:42 +01:00
|
|
|
_equalAggref(Aggref *a, Aggref *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(aggfnoid);
|
|
|
|
COMPARE_SCALAR_FIELD(aggtype);
|
2006-07-27 21:52:07 +02:00
|
|
|
COMPARE_NODE_FIELD(args);
|
2003-06-06 17:04:03 +02:00
|
|
|
COMPARE_SCALAR_FIELD(agglevelsup);
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_SCALAR_FIELD(aggstar);
|
|
|
|
COMPARE_SCALAR_FIELD(aggdistinct);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
|
|
|
{
|
2003-04-09 01:20:04 +02:00
|
|
|
COMPARE_SCALAR_FIELD(refarraytype);
|
|
|
|
COMPARE_SCALAR_FIELD(refelemtype);
|
2007-03-17 01:11:05 +01:00
|
|
|
COMPARE_SCALAR_FIELD(reftypmod);
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(refupperindexpr);
|
|
|
|
COMPARE_NODE_FIELD(reflowerindexpr);
|
|
|
|
COMPARE_NODE_FIELD(refexpr);
|
|
|
|
COMPARE_NODE_FIELD(refassgnexpr);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalFuncExpr(FuncExpr *a, FuncExpr *b)
|
1999-07-29 04:45:36 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(funcid);
|
|
|
|
COMPARE_SCALAR_FIELD(funcresulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(funcretset);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
*/
|
|
|
|
if (a->funcformat != b->funcformat &&
|
|
|
|
a->funcformat != COERCE_DONTCARE &&
|
|
|
|
b->funcformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(args);
|
1999-07-29 04:45:36 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
1999-06-06 19:46:40 +02:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalOpExpr(OpExpr *a, OpExpr *b)
|
1999-06-06 19:46:40 +02:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_SCALAR_FIELD(opno);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
/*
|
2003-08-04 02:43:34 +02:00
|
|
|
* Special-case opfuncid: it is allowable for it to differ if one node
|
2005-10-15 04:49:52 +02:00
|
|
|
* contains zero and the other doesn't. This just means that the one node
|
|
|
|
* isn't as far along in the parse/plan pipeline and hasn't had the
|
|
|
|
* opfuncid cache filled yet.
|
2002-12-12 16:49:42 +01:00
|
|
|
*/
|
|
|
|
if (a->opfuncid != b->opfuncid &&
|
|
|
|
a->opfuncid != 0 &&
|
|
|
|
b->opfuncid != 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
COMPARE_SCALAR_FIELD(opresulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(opretset);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
|
2002-12-12 16:49:42 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(opno);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
/*
|
2003-08-04 02:43:34 +02:00
|
|
|
* Special-case opfuncid: it is allowable for it to differ if one node
|
2005-10-15 04:49:52 +02:00
|
|
|
* contains zero and the other doesn't. This just means that the one node
|
|
|
|
* isn't as far along in the parse/plan pipeline and hasn't had the
|
|
|
|
* opfuncid cache filled yet.
|
2002-12-12 16:49:42 +01:00
|
|
|
*/
|
|
|
|
if (a->opfuncid != b->opfuncid &&
|
|
|
|
a->opfuncid != 0 &&
|
|
|
|
b->opfuncid != 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
COMPARE_SCALAR_FIELD(opresulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(opretset);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-06-29 02:33:44 +02:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
|
2003-06-29 02:33:44 +02:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(opno);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2003-06-29 02:33:44 +02:00
|
|
|
/*
|
2003-08-04 02:43:34 +02:00
|
|
|
* Special-case opfuncid: it is allowable for it to differ if one node
|
2005-10-15 04:49:52 +02:00
|
|
|
* contains zero and the other doesn't. This just means that the one node
|
|
|
|
* isn't as far along in the parse/plan pipeline and hasn't had the
|
|
|
|
* opfuncid cache filled yet.
|
2003-06-29 02:33:44 +02:00
|
|
|
*/
|
|
|
|
if (a->opfuncid != b->opfuncid &&
|
|
|
|
a->opfuncid != 0 &&
|
|
|
|
b->opfuncid != 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
COMPARE_SCALAR_FIELD(useOr);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalBoolExpr(BoolExpr *a, BoolExpr *b)
|
2002-12-12 16:49:42 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(boolop);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
1999-06-06 19:46:40 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
1999-09-26 04:28:44 +02:00
|
|
|
static bool
|
|
|
|
_equalSubLink(SubLink *a, SubLink *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(subLinkType);
|
2005-12-28 02:30:02 +01:00
|
|
|
COMPARE_NODE_FIELD(testexpr);
|
2003-01-10 22:08:15 +01:00
|
|
|
COMPARE_NODE_FIELD(operName);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(subselect);
|
1999-09-26 04:28:44 +02:00
|
|
|
|
2002-08-26 19:54:02 +02:00
|
|
|
return true;
|
2000-09-12 23:07:18 +02:00
|
|
|
}
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
static bool
|
2002-12-14 01:17:59 +01:00
|
|
|
_equalSubPlan(SubPlan *a, SubPlan *b)
|
2002-12-12 16:49:42 +01:00
|
|
|
{
|
2002-12-14 01:17:59 +01:00
|
|
|
COMPARE_SCALAR_FIELD(subLinkType);
|
2005-12-28 02:30:02 +01:00
|
|
|
COMPARE_NODE_FIELD(testexpr);
|
2004-05-26 06:41:50 +02:00
|
|
|
COMPARE_NODE_FIELD(paramIds);
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_SCALAR_FIELD(plan_id);
|
2007-02-22 23:00:26 +01:00
|
|
|
COMPARE_SCALAR_FIELD(firstColType);
|
2003-01-10 22:08:15 +01:00
|
|
|
COMPARE_SCALAR_FIELD(useHashTable);
|
|
|
|
COMPARE_SCALAR_FIELD(unknownEqFalse);
|
2004-05-26 06:41:50 +02:00
|
|
|
COMPARE_NODE_FIELD(setParam);
|
|
|
|
COMPARE_NODE_FIELD(parParam);
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-08 17:43:12 +02:00
|
|
|
static bool
|
|
|
|
_equalFieldSelect(FieldSelect *a, FieldSelect *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(fieldnum);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttypmod);
|
|
|
|
|
2000-08-08 17:43:12 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-06-09 21:08:20 +02:00
|
|
|
static bool
|
|
|
|
_equalFieldStore(FieldStore *a, FieldStore *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_NODE_FIELD(newvals);
|
|
|
|
COMPARE_NODE_FIELD(fieldnums);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-02-20 22:32:16 +01:00
|
|
|
static bool
|
|
|
|
_equalRelabelType(RelabelType *a, RelabelType *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttypmod);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
*/
|
|
|
|
if (a->relabelformat != b->relabelformat &&
|
|
|
|
a->relabelformat != COERCE_DONTCARE &&
|
|
|
|
b->relabelformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2000-02-20 22:32:16 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-06-05 23:31:09 +02:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
|
2007-06-05 23:31:09 +02:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
|
|
|
*/
|
|
|
|
if (a->coerceformat != b->coerceformat &&
|
|
|
|
a->coerceformat != COERCE_DONTCARE &&
|
|
|
|
b->coerceformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-03-28 01:21:12 +02:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
|
2007-03-28 01:21:12 +02:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(elemfuncid);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttypmod);
|
|
|
|
COMPARE_SCALAR_FIELD(isExplicit);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
|
|
|
*/
|
|
|
|
if (a->coerceformat != b->coerceformat &&
|
|
|
|
a->coerceformat != COERCE_DONTCARE &&
|
|
|
|
b->coerceformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-12-12 00:26:51 +01:00
|
|
|
static bool
|
|
|
|
_equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
|
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
2004-12-12 00:26:51 +01:00
|
|
|
*/
|
|
|
|
if (a->convertformat != b->convertformat &&
|
|
|
|
a->convertformat != COERCE_DONTCARE &&
|
|
|
|
b->convertformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
2002-12-12 16:49:42 +01:00
|
|
|
_equalCaseExpr(CaseExpr *a, CaseExpr *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_SCALAR_FIELD(casetype);
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_NODE_FIELD(defresult);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-12-12 16:49:42 +01:00
|
|
|
_equalCaseWhen(CaseWhen *a, CaseWhen *b)
|
2002-11-25 04:33:27 +01:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(expr);
|
|
|
|
COMPARE_NODE_FIELD(result);
|
2000-09-12 23:07:18 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-03-17 21:48:43 +01:00
|
|
|
static bool
|
|
|
|
_equalCaseTestExpr(CaseTestExpr *a, CaseTestExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(typeId);
|
|
|
|
COMPARE_SCALAR_FIELD(typeMod);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-04-09 01:20:04 +02:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
|
2003-04-09 01:20:04 +02:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(array_typeid);
|
|
|
|
COMPARE_SCALAR_FIELD(element_typeid);
|
|
|
|
COMPARE_NODE_FIELD(elements);
|
2003-08-18 01:43:27 +02:00
|
|
|
COMPARE_SCALAR_FIELD(multidims);
|
2003-04-09 01:20:04 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-05-11 00:44:49 +02:00
|
|
|
static bool
|
|
|
|
_equalRowExpr(RowExpr *a, RowExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(row_typeid);
|
|
|
|
|
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
2004-05-11 00:44:49 +02:00
|
|
|
*/
|
|
|
|
if (a->row_format != b->row_format &&
|
|
|
|
a->row_format != COERCE_DONTCARE &&
|
|
|
|
b->row_format != COERCE_DONTCARE)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-12-28 02:30:02 +01:00
|
|
|
static bool
|
|
|
|
_equalRowCompareExpr(RowCompareExpr *a, RowCompareExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(rctype);
|
|
|
|
COMPARE_NODE_FIELD(opnos);
|
2006-12-23 01:43:13 +01:00
|
|
|
COMPARE_NODE_FIELD(opfamilies);
|
2005-12-28 02:30:02 +01:00
|
|
|
COMPARE_NODE_FIELD(largs);
|
|
|
|
COMPARE_NODE_FIELD(rargs);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-02-16 03:30:39 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
|
2003-02-16 03:30:39 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(coalescetype);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-06-27 00:05:42 +02:00
|
|
|
static bool
|
|
|
|
_equalMinMaxExpr(MinMaxExpr *a, MinMaxExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(minmaxtype);
|
|
|
|
COMPARE_SCALAR_FIELD(op);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-12-24 01:29:20 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalXmlExpr(XmlExpr *a, XmlExpr *b)
|
2006-12-24 01:29:20 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(op);
|
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(named_args);
|
|
|
|
COMPARE_NODE_FIELD(arg_names);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
2007-02-03 15:06:56 +01:00
|
|
|
COMPARE_SCALAR_FIELD(xmloption);
|
|
|
|
COMPARE_SCALAR_FIELD(type);
|
|
|
|
COMPARE_SCALAR_FIELD(typmod);
|
2006-12-24 01:29:20 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-02-16 03:30:39 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
|
2003-02-16 03:30:39 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(opno);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2003-02-16 03:30:39 +01:00
|
|
|
/*
|
2003-08-04 02:43:34 +02:00
|
|
|
* Special-case opfuncid: it is allowable for it to differ if one node
|
2005-10-15 04:49:52 +02:00
|
|
|
* contains zero and the other doesn't. This just means that the one node
|
|
|
|
* isn't as far along in the parse/plan pipeline and hasn't had the
|
|
|
|
* opfuncid cache filled yet.
|
2003-02-16 03:30:39 +01:00
|
|
|
*/
|
|
|
|
if (a->opfuncid != b->opfuncid &&
|
|
|
|
a->opfuncid != 0 &&
|
|
|
|
b->opfuncid != 0)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
COMPARE_SCALAR_FIELD(opresulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(opretset);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-09-29 20:21:41 +02:00
|
|
|
static bool
|
2002-12-12 16:49:42 +01:00
|
|
|
_equalNullTest(NullTest *a, NullTest *b)
|
2000-09-29 20:21:41 +02:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(nulltesttype);
|
2000-09-29 20:21:41 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-09-12 23:07:18 +02:00
|
|
|
static bool
|
2002-12-12 16:49:42 +01:00
|
|
|
_equalBooleanTest(BooleanTest *a, BooleanTest *b)
|
2000-09-12 23:07:18 +02:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_SCALAR_FIELD(booltesttype);
|
2000-09-12 23:07:18 +02:00
|
|
|
|
|
|
|
return true;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
|
2002-12-12 16:49:42 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
2003-02-03 22:15:45 +01:00
|
|
|
COMPARE_SCALAR_FIELD(resulttype);
|
|
|
|
COMPARE_SCALAR_FIELD(resulttypmod);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2003-02-03 22:15:45 +01:00
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Special-case COERCE_DONTCARE, so that planner can build coercion nodes
|
|
|
|
* that are equal() to both explicit and implicit coercions.
|
2003-02-03 22:15:45 +01:00
|
|
|
*/
|
|
|
|
if (a->coercionformat != b->coercionformat &&
|
|
|
|
a->coercionformat != COERCE_DONTCARE &&
|
|
|
|
b->coercionformat != COERCE_DONTCARE)
|
|
|
|
return false;
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
return true;
|
|
|
|
}
|
2002-11-25 04:33:27 +01:00
|
|
|
|
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
|
2002-11-25 04:33:27 +01:00
|
|
|
{
|
2002-12-12 16:49:42 +01:00
|
|
|
COMPARE_SCALAR_FIELD(typeId);
|
|
|
|
COMPARE_SCALAR_FIELD(typeMod);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-07-03 18:34:26 +02:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalSetToDefault(SetToDefault *a, SetToDefault *b)
|
2003-07-03 18:34:26 +02:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(typeId);
|
|
|
|
COMPARE_SCALAR_FIELD(typeMod);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-06-11 03:16:30 +02:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
|
2007-06-11 03:16:30 +02:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(cvarno);
|
|
|
|
COMPARE_STRING_FIELD(cursor_name);
|
2007-06-12 00:22:42 +02:00
|
|
|
COMPARE_SCALAR_FIELD(cursor_param);
|
2007-06-11 03:16:30 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
static bool
|
|
|
|
_equalTargetEntry(TargetEntry *a, TargetEntry *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(expr);
|
2005-04-06 18:34:07 +02:00
|
|
|
COMPARE_SCALAR_FIELD(resno);
|
|
|
|
COMPARE_STRING_FIELD(resname);
|
|
|
|
COMPARE_SCALAR_FIELD(ressortgroupref);
|
|
|
|
COMPARE_SCALAR_FIELD(resorigtbl);
|
|
|
|
COMPARE_SCALAR_FIELD(resorigcol);
|
|
|
|
COMPARE_SCALAR_FIELD(resjunk);
|
2002-12-12 16:49:42 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalRangeTblRef(RangeTblRef *a, RangeTblRef *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(rtindex);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalJoinExpr(JoinExpr *a, JoinExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(jointype);
|
|
|
|
COMPARE_SCALAR_FIELD(isNatural);
|
|
|
|
COMPARE_NODE_FIELD(larg);
|
|
|
|
COMPARE_NODE_FIELD(rarg);
|
|
|
|
COMPARE_NODE_FIELD(using);
|
|
|
|
COMPARE_NODE_FIELD(quals);
|
|
|
|
COMPARE_NODE_FIELD(alias);
|
|
|
|
COMPARE_SCALAR_FIELD(rtindex);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalFromExpr(FromExpr *a, FromExpr *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(fromlist);
|
|
|
|
COMPARE_NODE_FIELD(quals);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-08-02 00:12:13 +02:00
|
|
|
/*
|
1999-07-29 04:45:36 +02:00
|
|
|
* Stuff from relation.h
|
1998-08-02 00:12:13 +02:00
|
|
|
*/
|
1999-07-29 04:45:36 +02:00
|
|
|
|
1998-02-13 04:27:47 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalPathKey(PathKey *a, PathKey *b)
|
1998-02-13 04:27:47 +01:00
|
|
|
{
|
2007-01-20 21:45:41 +01:00
|
|
|
/*
|
2007-11-15 22:14:46 +01:00
|
|
|
* This is normally used on non-canonicalized PathKeys, so must chase up
|
|
|
|
* to the topmost merged EquivalenceClass and see if those are the same
|
|
|
|
* (by pointer equality).
|
2007-01-20 21:45:41 +01:00
|
|
|
*/
|
|
|
|
EquivalenceClass *a_eclass;
|
|
|
|
EquivalenceClass *b_eclass;
|
|
|
|
|
|
|
|
a_eclass = a->pk_eclass;
|
|
|
|
while (a_eclass->ec_merged)
|
|
|
|
a_eclass = a_eclass->ec_merged;
|
|
|
|
b_eclass = b->pk_eclass;
|
|
|
|
while (b_eclass->ec_merged)
|
|
|
|
b_eclass = b_eclass->ec_merged;
|
|
|
|
if (a_eclass != b_eclass)
|
|
|
|
return false;
|
|
|
|
COMPARE_SCALAR_FIELD(pk_opfamily);
|
|
|
|
COMPARE_SCALAR_FIELD(pk_strategy);
|
|
|
|
COMPARE_SCALAR_FIELD(pk_nulls_first);
|
1998-02-26 05:46:47 +01:00
|
|
|
|
1998-09-01 05:29:17 +02:00
|
|
|
return true;
|
1998-02-13 04:27:47 +01:00
|
|
|
}
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
1999-08-16 04:17:58 +02:00
|
|
|
_equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(clause);
|
2004-01-05 06:07:36 +01:00
|
|
|
COMPARE_SCALAR_FIELD(is_pushed_down);
|
2005-11-15 00:54:23 +01:00
|
|
|
COMPARE_SCALAR_FIELD(outerjoin_delayed);
|
2005-06-09 06:19:00 +02:00
|
|
|
COMPARE_BITMAPSET_FIELD(required_relids);
|
2003-08-04 02:43:34 +02:00
|
|
|
|
2001-06-05 07:26:05 +02:00
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* We ignore all the remaining fields, since they may not be set yet, and
|
|
|
|
* should be derivable from the clause anyway.
|
2001-06-05 07:26:05 +02:00
|
|
|
*/
|
2002-11-25 04:33:27 +01:00
|
|
|
|
1998-09-01 05:29:17 +02:00
|
|
|
return true;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
|
|
|
|
2005-12-20 03:30:36 +01:00
|
|
|
static bool
|
|
|
|
_equalOuterJoinInfo(OuterJoinInfo *a, OuterJoinInfo *b)
|
|
|
|
{
|
|
|
|
COMPARE_BITMAPSET_FIELD(min_lefthand);
|
|
|
|
COMPARE_BITMAPSET_FIELD(min_righthand);
|
2007-08-31 03:44:06 +02:00
|
|
|
COMPARE_BITMAPSET_FIELD(syn_lefthand);
|
|
|
|
COMPARE_BITMAPSET_FIELD(syn_righthand);
|
2005-12-20 03:30:36 +01:00
|
|
|
COMPARE_SCALAR_FIELD(is_full_join);
|
|
|
|
COMPARE_SCALAR_FIELD(lhs_strict);
|
2007-05-23 01:23:58 +02:00
|
|
|
COMPARE_SCALAR_FIELD(delay_upper_joins);
|
2005-12-20 03:30:36 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-01-20 19:55:07 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
|
2003-01-20 19:55:07 +01:00
|
|
|
{
|
2003-02-08 21:20:55 +01:00
|
|
|
COMPARE_BITMAPSET_FIELD(lefthand);
|
|
|
|
COMPARE_BITMAPSET_FIELD(righthand);
|
2003-01-20 19:55:07 +01:00
|
|
|
COMPARE_NODE_FIELD(sub_targetlist);
|
2007-01-10 19:06:05 +01:00
|
|
|
COMPARE_NODE_FIELD(in_operators);
|
2003-01-20 19:55:07 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-01-31 22:39:25 +01:00
|
|
|
static bool
|
|
|
|
_equalAppendRelInfo(AppendRelInfo *a, AppendRelInfo *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(parent_relid);
|
|
|
|
COMPARE_SCALAR_FIELD(child_relid);
|
|
|
|
COMPARE_SCALAR_FIELD(parent_reltype);
|
|
|
|
COMPARE_SCALAR_FIELD(child_reltype);
|
|
|
|
COMPARE_NODE_FIELD(col_mappings);
|
|
|
|
COMPARE_NODE_FIELD(translated_vars);
|
|
|
|
COMPARE_SCALAR_FIELD(parent_reloid);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
|
1999-02-07 01:52:12 +01:00
|
|
|
/*
|
|
|
|
* Stuff from parsenodes.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalQuery(Query *a, Query *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(commandType);
|
|
|
|
COMPARE_SCALAR_FIELD(querySource);
|
2003-05-02 22:54:36 +02:00
|
|
|
COMPARE_SCALAR_FIELD(canSetTag);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(utilityStmt);
|
|
|
|
COMPARE_SCALAR_FIELD(resultRelation);
|
2007-04-28 00:05:49 +02:00
|
|
|
COMPARE_NODE_FIELD(intoClause);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(hasAggs);
|
|
|
|
COMPARE_SCALAR_FIELD(hasSubLinks);
|
|
|
|
COMPARE_NODE_FIELD(rtable);
|
|
|
|
COMPARE_NODE_FIELD(jointree);
|
|
|
|
COMPARE_NODE_FIELD(targetList);
|
2006-08-12 04:52:06 +02:00
|
|
|
COMPARE_NODE_FIELD(returningList);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(groupClause);
|
|
|
|
COMPARE_NODE_FIELD(havingQual);
|
|
|
|
COMPARE_NODE_FIELD(distinctClause);
|
|
|
|
COMPARE_NODE_FIELD(sortClause);
|
|
|
|
COMPARE_NODE_FIELD(limitOffset);
|
|
|
|
COMPARE_NODE_FIELD(limitCount);
|
2006-04-30 20:30:40 +02:00
|
|
|
COMPARE_NODE_FIELD(rowMarks);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(setOperations);
|
1999-02-07 01:52:12 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalInsertStmt(InsertStmt *a, InsertStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(cols);
|
|
|
|
COMPARE_NODE_FIELD(selectStmt);
|
2006-08-12 04:52:06 +02:00
|
|
|
COMPARE_NODE_FIELD(returningList);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDeleteStmt(DeleteStmt *a, DeleteStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2005-04-07 03:51:41 +02:00
|
|
|
COMPARE_NODE_FIELD(usingClause);
|
2006-08-12 04:52:06 +02:00
|
|
|
COMPARE_NODE_FIELD(whereClause);
|
|
|
|
COMPARE_NODE_FIELD(returningList);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalUpdateStmt(UpdateStmt *a, UpdateStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(targetList);
|
|
|
|
COMPARE_NODE_FIELD(whereClause);
|
|
|
|
COMPARE_NODE_FIELD(fromClause);
|
2006-08-12 04:52:06 +02:00
|
|
|
COMPARE_NODE_FIELD(returningList);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalSelectStmt(SelectStmt *a, SelectStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(distinctClause);
|
2007-04-28 00:05:49 +02:00
|
|
|
COMPARE_NODE_FIELD(intoClause);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(targetList);
|
|
|
|
COMPARE_NODE_FIELD(fromClause);
|
|
|
|
COMPARE_NODE_FIELD(whereClause);
|
|
|
|
COMPARE_NODE_FIELD(groupClause);
|
|
|
|
COMPARE_NODE_FIELD(havingClause);
|
2006-08-02 03:59:48 +02:00
|
|
|
COMPARE_NODE_FIELD(valuesLists);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(sortClause);
|
|
|
|
COMPARE_NODE_FIELD(limitOffset);
|
|
|
|
COMPARE_NODE_FIELD(limitCount);
|
2005-08-01 22:31:16 +02:00
|
|
|
COMPARE_NODE_FIELD(lockingClause);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(op);
|
|
|
|
COMPARE_SCALAR_FIELD(all);
|
|
|
|
COMPARE_NODE_FIELD(larg);
|
|
|
|
COMPARE_NODE_FIELD(rarg);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-10-05 21:11:39 +02:00
|
|
|
static bool
|
|
|
|
_equalSetOperationStmt(SetOperationStmt *a, SetOperationStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(op);
|
|
|
|
COMPARE_SCALAR_FIELD(all);
|
|
|
|
COMPARE_NODE_FIELD(larg);
|
|
|
|
COMPARE_NODE_FIELD(rarg);
|
2004-05-26 06:41:50 +02:00
|
|
|
COMPARE_NODE_FIELD(colTypes);
|
2006-08-10 04:36:29 +02:00
|
|
|
COMPARE_NODE_FIELD(colTypmods);
|
2000-10-05 21:11:39 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
|
1999-02-07 01:52:12 +01:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2004-05-05 06:48:48 +02:00
|
|
|
COMPARE_NODE_FIELD(cmds);
|
2004-08-22 02:08:28 +02:00
|
|
|
COMPARE_SCALAR_FIELD(relkind);
|
2004-05-05 06:48:48 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalAlterTableCmd(AlterTableCmd *a, AlterTableCmd *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(subtype);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(def);
|
2004-05-05 06:48:48 +02:00
|
|
|
COMPARE_NODE_FIELD(transform);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-12-06 06:00:34 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
|
2002-12-06 06:00:34 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(subtype);
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(def);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
2001-06-10 01:21:55 +02:00
|
|
|
_equalGrantStmt(GrantStmt *a, GrantStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(is_grant);
|
|
|
|
COMPARE_SCALAR_FIELD(objtype);
|
|
|
|
COMPARE_NODE_FIELD(objects);
|
2004-05-26 06:41:50 +02:00
|
|
|
COMPARE_NODE_FIELD(privileges);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(grantees);
|
2003-01-24 00:39:07 +01:00
|
|
|
COMPARE_SCALAR_FIELD(grant_option);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2001-06-10 01:21:55 +02:00
|
|
|
static bool
|
|
|
|
_equalPrivGrantee(PrivGrantee *a, PrivGrantee *b)
|
|
|
|
{
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_STRING_FIELD(rolname);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
|
|
|
return true;
|
2001-10-25 07:50:21 +02:00
|
|
|
}
|
2001-06-10 01:21:55 +02:00
|
|
|
|
2002-02-19 00:11:58 +01:00
|
|
|
static bool
|
|
|
|
_equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(funcname);
|
|
|
|
COMPARE_NODE_FIELD(funcargs);
|
|
|
|
|
|
|
|
return true;
|
2002-02-19 00:11:58 +01:00
|
|
|
}
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
static bool
|
|
|
|
_equalGrantRoleStmt(GrantRoleStmt *a, GrantRoleStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(granted_roles);
|
|
|
|
COMPARE_NODE_FIELD(grantee_roles);
|
|
|
|
COMPARE_SCALAR_FIELD(is_grant);
|
|
|
|
COMPARE_SCALAR_FIELD(admin_opt);
|
|
|
|
COMPARE_STRING_FIELD(grantor);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-03-10 04:53:52 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
|
2003-03-10 04:53:52 +01:00
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(portalname);
|
|
|
|
COMPARE_SCALAR_FIELD(options);
|
|
|
|
COMPARE_NODE_FIELD(query);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalClosePortalStmt(ClosePortalStmt *a, ClosePortalStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(portalname);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalClusterStmt(ClusterStmt *a, ClusterStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_STRING_FIELD(indexname);
|
1999-02-07 01:52:12 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-01-31 02:21:39 +01:00
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalCopyStmt(CopyStmt *a, CopyStmt *b)
|
2000-01-31 02:21:39 +01:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2006-08-31 01:34:22 +02:00
|
|
|
COMPARE_NODE_FIELD(query);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(attlist);
|
|
|
|
COMPARE_SCALAR_FIELD(is_from);
|
|
|
|
COMPARE_STRING_FIELD(filename);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
2000-01-31 02:21:39 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-06-29 09:35:57 +02:00
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalCreateStmt(CreateStmt *a, CreateStmt *b)
|
2000-06-29 09:35:57 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(tableElts);
|
|
|
|
COMPARE_NODE_FIELD(inhRelations);
|
|
|
|
COMPARE_NODE_FIELD(constraints);
|
2006-07-02 04:23:23 +02:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(oncommit);
|
2004-06-18 08:14:31 +02:00
|
|
|
COMPARE_STRING_FIELD(tablespacename);
|
2000-06-29 09:35:57 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-06-25 05:40:19 +02:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalInhRelation(InhRelation *a, InhRelation *b)
|
2003-06-25 05:40:19 +02:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(relation);
|
2006-06-27 05:43:20 +02:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2003-06-25 05:40:19 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
1999-07-29 04:45:36 +02:00
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalDefineStmt(DefineStmt *a, DefineStmt *b)
|
1999-07-29 04:45:36 +02:00
|
|
|
{
|
2003-02-10 05:44:47 +01:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
2006-04-15 19:45:46 +02:00
|
|
|
COMPARE_SCALAR_FIELD(oldstyle);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(defnames);
|
2006-04-15 19:45:46 +02:00
|
|
|
COMPARE_NODE_FIELD(args);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(definition);
|
1999-07-29 04:45:36 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalDropStmt(DropStmt *a, DropStmt *b)
|
1999-07-29 04:45:36 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(objects);
|
|
|
|
COMPARE_SCALAR_FIELD(removeType);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2005-11-21 00:24:12 +01:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
1999-07-29 04:45:36 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalTruncateStmt(TruncateStmt *a, TruncateStmt *b)
|
|
|
|
{
|
2005-01-27 04:19:37 +01:00
|
|
|
COMPARE_NODE_FIELD(relations);
|
2006-03-03 04:30:54 +01:00
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
1999-02-07 01:52:12 +01:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
static bool
|
2000-08-12 01:45:35 +02:00
|
|
|
_equalCommentStmt(CommentStmt *a, CommentStmt *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(objtype);
|
|
|
|
COMPARE_NODE_FIELD(objname);
|
|
|
|
COMPARE_NODE_FIELD(objargs);
|
|
|
|
COMPARE_STRING_FIELD(comment);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalFetchStmt(FetchStmt *a, FetchStmt *b)
|
1996-07-09 08:22:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(direction);
|
|
|
|
COMPARE_SCALAR_FIELD(howMany);
|
|
|
|
COMPARE_STRING_FIELD(portalname);
|
|
|
|
COMPARE_SCALAR_FIELD(ismove);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
return true;
|
|
|
|
}
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalIndexStmt(IndexStmt *a, IndexStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(idxname);
|
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_STRING_FIELD(accessMethod);
|
2004-06-18 08:14:31 +02:00
|
|
|
COMPARE_STRING_FIELD(tableSpace);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(indexParams);
|
2006-07-02 04:23:23 +02:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2007-07-17 07:02:03 +02:00
|
|
|
COMPARE_STRING_FIELD(src_options);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(whereClause);
|
|
|
|
COMPARE_SCALAR_FIELD(unique);
|
|
|
|
COMPARE_SCALAR_FIELD(primary);
|
|
|
|
COMPARE_SCALAR_FIELD(isconstraint);
|
2006-08-25 06:06:58 +02:00
|
|
|
COMPARE_SCALAR_FIELD(concurrent);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-05-17 20:32:52 +02:00
|
|
|
_equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(replace);
|
|
|
|
COMPARE_NODE_FIELD(funcname);
|
2004-01-07 00:55:19 +01:00
|
|
|
COMPARE_NODE_FIELD(parameters);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(returnType);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
|
|
|
COMPARE_NODE_FIELD(withClause);
|
1997-09-07 07:04:48 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-01-07 00:55:19 +01:00
|
|
|
static bool
|
|
|
|
_equalFunctionParameter(FunctionParameter *a, FunctionParameter *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(argType);
|
2005-03-29 19:58:51 +02:00
|
|
|
COMPARE_SCALAR_FIELD(mode);
|
2004-01-07 00:55:19 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-03-14 01:19:37 +01:00
|
|
|
static bool
|
|
|
|
_equalAlterFunctionStmt(AlterFunctionStmt *a, AlterFunctionStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(func);
|
|
|
|
COMPARE_NODE_FIELD(actions);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalRemoveFuncStmt(RemoveFuncStmt *a, RemoveFuncStmt *b)
|
|
|
|
{
|
2006-04-15 19:45:46 +02:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
|
|
|
COMPARE_NODE_FIELD(name);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-07-30 00:14:11 +02:00
|
|
|
static bool
|
|
|
|
_equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(opclassname);
|
|
|
|
COMPARE_STRING_FIELD(amname);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2002-07-30 00:14:11 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2000-08-12 01:45:35 +02:00
|
|
|
|
2007-01-23 06:07:18 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalRemoveOpFamilyStmt(RemoveOpFamilyStmt *a, RemoveOpFamilyStmt *b)
|
2007-01-23 06:07:18 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(opfamilyname);
|
|
|
|
COMPARE_STRING_FIELD(amname);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalRenameStmt(RenameStmt *a, RenameStmt *b)
|
|
|
|
{
|
2005-08-01 06:03:59 +02:00
|
|
|
COMPARE_SCALAR_FIELD(renameType);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2003-06-27 16:45:32 +02:00
|
|
|
COMPARE_NODE_FIELD(object);
|
|
|
|
COMPARE_NODE_FIELD(objarg);
|
|
|
|
COMPARE_STRING_FIELD(subname);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(newname);
|
2005-08-01 06:03:59 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalAlterObjectSchemaStmt(AlterObjectSchemaStmt *a, AlterObjectSchemaStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(objectType);
|
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(object);
|
|
|
|
COMPARE_NODE_FIELD(objarg);
|
|
|
|
COMPARE_STRING_FIELD(addname);
|
|
|
|
COMPARE_STRING_FIELD(newschema);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-06-25 23:55:59 +02:00
|
|
|
static bool
|
|
|
|
_equalAlterOwnerStmt(AlterOwnerStmt *a, AlterOwnerStmt *b)
|
|
|
|
{
|
2005-08-01 06:03:59 +02:00
|
|
|
COMPARE_SCALAR_FIELD(objectType);
|
2004-06-25 23:55:59 +02:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(object);
|
|
|
|
COMPARE_NODE_FIELD(objarg);
|
|
|
|
COMPARE_STRING_FIELD(addname);
|
|
|
|
COMPARE_STRING_FIELD(newowner);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalRuleStmt(RuleStmt *a, RuleStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_STRING_FIELD(rulename);
|
|
|
|
COMPARE_NODE_FIELD(whereClause);
|
|
|
|
COMPARE_SCALAR_FIELD(event);
|
|
|
|
COMPARE_SCALAR_FIELD(instead);
|
|
|
|
COMPARE_NODE_FIELD(actions);
|
|
|
|
COMPARE_SCALAR_FIELD(replace);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalNotifyStmt(NotifyStmt *a, NotifyStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalListenStmt(ListenStmt *a, ListenStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
|
|
|
|
{
|
2003-02-10 05:44:47 +01:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2005-06-18 00:32:51 +02:00
|
|
|
COMPARE_STRING_FIELD(gid);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-08-15 18:36:08 +02:00
|
|
|
static bool
|
|
|
|
_equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(typevar);
|
|
|
|
COMPARE_NODE_FIELD(coldeflist);
|
2002-08-15 18:36:08 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-04-02 05:49:42 +02:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
|
2007-04-02 05:49:42 +02:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
|
|
|
COMPARE_NODE_FIELD(vals);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-11-25 04:33:27 +01:00
|
|
|
static bool
|
|
|
|
_equalViewStmt(ViewStmt *a, ViewStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(view);
|
|
|
|
COMPARE_NODE_FIELD(aliases);
|
|
|
|
COMPARE_NODE_FIELD(query);
|
|
|
|
COMPARE_SCALAR_FIELD(replace);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalLoadStmt(LoadStmt *a, LoadStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(filename);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-19 03:18:25 +01:00
|
|
|
static bool
|
|
|
|
_equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(domainname);
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
|
|
|
COMPARE_NODE_FIELD(constraints);
|
2002-03-19 03:18:25 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-07-30 00:14:11 +02:00
|
|
|
static bool
|
|
|
|
_equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(opclassname);
|
2006-12-23 01:43:13 +01:00
|
|
|
COMPARE_NODE_FIELD(opfamilyname);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(amname);
|
|
|
|
COMPARE_NODE_FIELD(datatype);
|
|
|
|
COMPARE_NODE_FIELD(items);
|
|
|
|
COMPARE_SCALAR_FIELD(isDefault);
|
2002-07-30 00:14:11 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(itemtype);
|
|
|
|
COMPARE_NODE_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(number);
|
|
|
|
COMPARE_SCALAR_FIELD(recheck);
|
2007-01-23 06:07:18 +01:00
|
|
|
COMPARE_NODE_FIELD(class_args);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(storedtype);
|
2002-07-30 00:14:11 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-01-23 06:07:18 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalCreateOpFamilyStmt(CreateOpFamilyStmt *a, CreateOpFamilyStmt *b)
|
2007-01-23 06:07:18 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(opfamilyname);
|
|
|
|
COMPARE_STRING_FIELD(amname);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalAlterOpFamilyStmt(AlterOpFamilyStmt *a, AlterOpFamilyStmt *b)
|
2007-01-23 06:07:18 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(opfamilyname);
|
|
|
|
COMPARE_STRING_FIELD(amname);
|
|
|
|
COMPARE_SCALAR_FIELD(isDrop);
|
|
|
|
COMPARE_NODE_FIELD(items);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(dbname);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-07-31 19:19:22 +02:00
|
|
|
static bool
|
|
|
|
_equalAlterDatabaseStmt(AlterDatabaseStmt *a, AlterDatabaseStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(dbname);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-01 23:45:19 +01:00
|
|
|
static bool
|
|
|
|
_equalAlterDatabaseSetStmt(AlterDatabaseSetStmt *a, AlterDatabaseSetStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(dbname);
|
2007-09-03 20:46:30 +02:00
|
|
|
COMPARE_NODE_FIELD(setstmt);
|
2002-03-01 23:45:19 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalDropdbStmt(DropdbStmt *a, DropdbStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(dbname);
|
2005-11-22 16:24:18 +01:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalVacuumStmt(VacuumStmt *a, VacuumStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(vacuum);
|
|
|
|
COMPARE_SCALAR_FIELD(full);
|
|
|
|
COMPARE_SCALAR_FIELD(analyze);
|
|
|
|
COMPARE_SCALAR_FIELD(verbose);
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
COMPARE_SCALAR_FIELD(freeze_min_age);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(va_cols);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalExplainStmt(ExplainStmt *a, ExplainStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(query);
|
|
|
|
COMPARE_SCALAR_FIELD(verbose);
|
|
|
|
COMPARE_SCALAR_FIELD(analyze);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(sequence);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2003-03-20 08:02:11 +01:00
|
|
|
static bool
|
2003-08-08 23:42:59 +02:00
|
|
|
_equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
|
2003-03-20 08:02:11 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(sequence);
|
|
|
|
COMPARE_NODE_FIELD(options);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalVariableSetStmt(VariableSetStmt *a, VariableSetStmt *b)
|
|
|
|
{
|
2007-09-03 20:46:30 +02:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(is_local);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalVariableShowStmt(VariableShowStmt *a, VariableShowStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-04-26 18:13:15 +02:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
|
2007-04-26 18:13:15 +02:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(target);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
static bool
|
|
|
|
_equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(tablespacename);
|
|
|
|
COMPARE_STRING_FIELD(owner);
|
|
|
|
COMPARE_STRING_FIELD(location);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDropTableSpaceStmt(DropTableSpaceStmt *a, DropTableSpaceStmt *b)
|
|
|
|
{
|
|
|
|
COMPARE_STRING_FIELD(tablespacename);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2004-06-18 08:14:31 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(trigname);
|
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_NODE_FIELD(funcname);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(before);
|
|
|
|
COMPARE_SCALAR_FIELD(row);
|
2003-08-04 02:43:34 +02:00
|
|
|
if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
|
2000-08-12 01:45:35 +02:00
|
|
|
return false;
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(isconstraint);
|
|
|
|
COMPARE_SCALAR_FIELD(deferrable);
|
|
|
|
COMPARE_SCALAR_FIELD(initdeferred);
|
|
|
|
COMPARE_NODE_FIELD(constrrel);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-04-18 22:01:11 +02:00
|
|
|
_equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_STRING_FIELD(property);
|
|
|
|
COMPARE_SCALAR_FIELD(removeType);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalCreatePLangStmt(CreatePLangStmt *a, CreatePLangStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(plname);
|
|
|
|
COMPARE_NODE_FIELD(plhandler);
|
|
|
|
COMPARE_NODE_FIELD(plvalidator);
|
|
|
|
COMPARE_SCALAR_FIELD(pltrusted);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDropPLangStmt(DropPLangStmt *a, DropPLangStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(plname);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2005-06-28 07:09:14 +02:00
|
|
|
_equalCreateRoleStmt(CreateRoleStmt *a, CreateRoleStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2005-07-26 18:38:29 +02:00
|
|
|
COMPARE_SCALAR_FIELD(stmt_type);
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_STRING_FIELD(role);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2005-06-28 07:09:14 +02:00
|
|
|
_equalAlterRoleStmt(AlterRoleStmt *a, AlterRoleStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_STRING_FIELD(role);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_SCALAR_FIELD(action);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-01 23:45:19 +01:00
|
|
|
static bool
|
2005-06-28 07:09:14 +02:00
|
|
|
_equalAlterRoleSetStmt(AlterRoleSetStmt *a, AlterRoleSetStmt *b)
|
2002-03-01 23:45:19 +01:00
|
|
|
{
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_STRING_FIELD(role);
|
2007-09-03 20:46:30 +02:00
|
|
|
COMPARE_NODE_FIELD(setstmt);
|
2002-03-01 23:45:19 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
2005-06-28 07:09:14 +02:00
|
|
|
_equalDropRoleStmt(DropRoleStmt *a, DropRoleStmt *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2005-06-28 07:09:14 +02:00
|
|
|
COMPARE_NODE_FIELD(roles);
|
2006-02-04 20:06:47 +01:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalLockStmt(LockStmt *a, LockStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relations);
|
|
|
|
COMPARE_SCALAR_FIELD(mode);
|
2004-03-11 02:47:41 +01:00
|
|
|
COMPARE_SCALAR_FIELD(nowait);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalConstraintsSetStmt(ConstraintsSetStmt *a, ConstraintsSetStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(constraints);
|
|
|
|
COMPARE_SCALAR_FIELD(deferred);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
|
|
|
|
{
|
2003-02-10 05:44:47 +01:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(relation);
|
|
|
|
COMPARE_STRING_FIELD(name);
|
2005-06-22 23:14:31 +02:00
|
|
|
COMPARE_SCALAR_FIELD(do_system);
|
|
|
|
COMPARE_SCALAR_FIELD(do_user);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-21 17:02:16 +01:00
|
|
|
static bool
|
|
|
|
_equalCreateSchemaStmt(CreateSchemaStmt *a, CreateSchemaStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(schemaname);
|
|
|
|
COMPARE_STRING_FIELD(authid);
|
|
|
|
COMPARE_NODE_FIELD(schemaElts);
|
2002-03-21 17:02:16 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-08-19 02:11:53 +02:00
|
|
|
static bool
|
|
|
|
_equalCreateConversionStmt(CreateConversionStmt *a, CreateConversionStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(conversion_name);
|
|
|
|
COMPARE_STRING_FIELD(for_encoding_name);
|
|
|
|
COMPARE_STRING_FIELD(to_encoding_name);
|
|
|
|
COMPARE_NODE_FIELD(func_name);
|
|
|
|
COMPARE_SCALAR_FIELD(def);
|
2002-08-19 02:11:53 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalCreateCastStmt(CreateCastStmt *a, CreateCastStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(sourcetype);
|
|
|
|
COMPARE_NODE_FIELD(targettype);
|
|
|
|
COMPARE_NODE_FIELD(func);
|
|
|
|
COMPARE_SCALAR_FIELD(context);
|
2002-08-19 02:11:53 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDropCastStmt(DropCastStmt *a, DropCastStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(sourcetype);
|
|
|
|
COMPARE_NODE_FIELD(targettype);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2006-06-16 22:23:45 +02:00
|
|
|
COMPARE_SCALAR_FIELD(missing_ok);
|
2002-08-19 02:11:53 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-08-27 06:55:12 +02:00
|
|
|
static bool
|
|
|
|
_equalPrepareStmt(PrepareStmt *a, PrepareStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(argtypes);
|
|
|
|
COMPARE_NODE_FIELD(query);
|
2002-08-27 06:55:12 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalExecuteStmt(ExecuteStmt *a, ExecuteStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(into);
|
|
|
|
COMPARE_NODE_FIELD(params);
|
2002-08-27 06:55:12 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
2002-08-27 06:55:12 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-11-21 13:49:33 +01:00
|
|
|
static bool
|
2006-10-04 02:30:14 +02:00
|
|
|
_equalDropOwnedStmt(DropOwnedStmt *a, DropOwnedStmt *b)
|
2005-11-21 13:49:33 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(roles);
|
|
|
|
COMPARE_SCALAR_FIELD(behavior);
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2005-11-21 13:49:33 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2006-10-04 02:30:14 +02:00
|
|
|
_equalReassignOwnedStmt(ReassignOwnedStmt *a, ReassignOwnedStmt *b)
|
2005-11-21 13:49:33 +01:00
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(roles);
|
|
|
|
COMPARE_NODE_FIELD(newrole);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalAExpr(A_Expr *a, A_Expr *b)
|
|
|
|
{
|
2003-02-10 05:44:47 +01:00
|
|
|
COMPARE_SCALAR_FIELD(kind);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(lexpr);
|
|
|
|
COMPARE_NODE_FIELD(rexpr);
|
2006-03-14 23:48:25 +01:00
|
|
|
COMPARE_SCALAR_FIELD(location);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-03-21 17:02:16 +01:00
|
|
|
_equalColumnRef(ColumnRef *a, ColumnRef *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(fields);
|
2006-03-14 23:48:25 +01:00
|
|
|
COMPARE_SCALAR_FIELD(location);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-03-21 17:02:16 +01:00
|
|
|
_equalParamRef(ParamRef *a, ParamRef *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(number);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-03-21 17:02:16 +01:00
|
|
|
_equalAConst(A_Const *a, A_Const *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2003-08-04 02:43:34 +02:00
|
|
|
if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
|
2000-08-12 01:45:35 +02:00
|
|
|
return false;
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(typename);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalFuncCall(FuncCall *a, FuncCall *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(funcname);
|
|
|
|
COMPARE_NODE_FIELD(args);
|
|
|
|
COMPARE_SCALAR_FIELD(agg_star);
|
|
|
|
COMPARE_SCALAR_FIELD(agg_distinct);
|
2006-03-14 23:48:25 +01:00
|
|
|
COMPARE_SCALAR_FIELD(location);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalAIndices(A_Indices *a, A_Indices *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(lidx);
|
|
|
|
COMPARE_NODE_FIELD(uidx);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-21 17:02:16 +01:00
|
|
|
static bool
|
2004-06-09 21:08:20 +02:00
|
|
|
_equalA_Indirection(A_Indirection *a, A_Indirection *b)
|
2002-03-21 17:02:16 +01:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_NODE_FIELD(indirection);
|
2002-03-21 17:02:16 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalResTarget(ResTarget *a, ResTarget *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(indirection);
|
|
|
|
COMPARE_NODE_FIELD(val);
|
2006-03-23 01:19:30 +01:00
|
|
|
COMPARE_SCALAR_FIELD(location);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2002-11-25 04:33:27 +01:00
|
|
|
_equalTypeName(TypeName *a, TypeName *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(names);
|
|
|
|
COMPARE_SCALAR_FIELD(typeid);
|
|
|
|
COMPARE_SCALAR_FIELD(timezone);
|
|
|
|
COMPARE_SCALAR_FIELD(setof);
|
|
|
|
COMPARE_SCALAR_FIELD(pct_type);
|
2006-12-30 22:21:56 +01:00
|
|
|
COMPARE_NODE_FIELD(typmods);
|
|
|
|
COMPARE_SCALAR_FIELD(typemod);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(arrayBounds);
|
2006-03-14 23:48:25 +01:00
|
|
|
COMPARE_SCALAR_FIELD(location);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-03-21 17:02:16 +01:00
|
|
|
static bool
|
2002-11-25 04:33:27 +01:00
|
|
|
_equalTypeCast(TypeCast *a, TypeCast *b)
|
2002-03-21 17:02:16 +01:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(arg);
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
2002-03-21 17:02:16 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
2003-08-17 21:58:06 +02:00
|
|
|
_equalSortBy(SortBy *a, SortBy *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2007-01-09 03:14:16 +01:00
|
|
|
COMPARE_SCALAR_FIELD(sortby_dir);
|
|
|
|
COMPARE_SCALAR_FIELD(sortby_nulls);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(useOp);
|
|
|
|
COMPARE_NODE_FIELD(node);
|
2002-08-05 01:49:59 +02:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
2000-09-12 23:07:18 +02:00
|
|
|
_equalRangeSubselect(RangeSubselect *a, RangeSubselect *b)
|
2000-08-12 01:45:35 +02:00
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(subquery);
|
|
|
|
COMPARE_NODE_FIELD(alias);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2002-05-12 22:10:05 +02:00
|
|
|
static bool
|
|
|
|
_equalRangeFunction(RangeFunction *a, RangeFunction *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(funccallnode);
|
|
|
|
COMPARE_NODE_FIELD(alias);
|
|
|
|
COMPARE_NODE_FIELD(coldeflist);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalIndexElem(IndexElem *a, IndexElem *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(name);
|
2003-05-28 18:04:02 +02:00
|
|
|
COMPARE_NODE_FIELD(expr);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_NODE_FIELD(opclass);
|
2007-01-09 03:14:16 +01:00
|
|
|
COMPARE_SCALAR_FIELD(ordering);
|
|
|
|
COMPARE_SCALAR_FIELD(nulls_ordering);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalColumnDef(ColumnDef *a, ColumnDef *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(colname);
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
|
|
|
COMPARE_SCALAR_FIELD(inhcount);
|
|
|
|
COMPARE_SCALAR_FIELD(is_local);
|
|
|
|
COMPARE_SCALAR_FIELD(is_not_null);
|
|
|
|
COMPARE_NODE_FIELD(raw_default);
|
|
|
|
COMPARE_STRING_FIELD(cooked_default);
|
|
|
|
COMPARE_NODE_FIELD(constraints);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalConstraint(Constraint *a, Constraint *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(contype);
|
|
|
|
COMPARE_STRING_FIELD(name);
|
|
|
|
COMPARE_NODE_FIELD(raw_expr);
|
|
|
|
COMPARE_STRING_FIELD(cooked_expr);
|
|
|
|
COMPARE_NODE_FIELD(keys);
|
2006-07-02 04:23:23 +02:00
|
|
|
COMPARE_NODE_FIELD(options);
|
2004-08-02 06:28:29 +02:00
|
|
|
COMPARE_STRING_FIELD(indexspace);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalDefElem(DefElem *a, DefElem *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(defname);
|
|
|
|
COMPARE_NODE_FIELD(arg);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-08-01 22:31:16 +02:00
|
|
|
static bool
|
|
|
|
_equalLockingClause(LockingClause *a, LockingClause *b)
|
|
|
|
{
|
|
|
|
COMPARE_NODE_FIELD(lockedRels);
|
|
|
|
COMPARE_SCALAR_FIELD(forUpdate);
|
2006-04-30 20:30:40 +02:00
|
|
|
COMPARE_SCALAR_FIELD(noWait);
|
2005-08-01 22:31:16 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalRangeTblEntry(RangeTblEntry *a, RangeTblEntry *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(rtekind);
|
|
|
|
COMPARE_SCALAR_FIELD(relid);
|
|
|
|
COMPARE_NODE_FIELD(subquery);
|
|
|
|
COMPARE_NODE_FIELD(funcexpr);
|
2006-03-16 01:31:55 +01:00
|
|
|
COMPARE_NODE_FIELD(funccoltypes);
|
|
|
|
COMPARE_NODE_FIELD(funccoltypmods);
|
2006-08-02 03:59:48 +02:00
|
|
|
COMPARE_NODE_FIELD(values_lists);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(jointype);
|
|
|
|
COMPARE_NODE_FIELD(joinaliasvars);
|
|
|
|
COMPARE_NODE_FIELD(alias);
|
|
|
|
COMPARE_NODE_FIELD(eref);
|
|
|
|
COMPARE_SCALAR_FIELD(inh);
|
|
|
|
COMPARE_SCALAR_FIELD(inFromCl);
|
2004-01-15 00:01:55 +01:00
|
|
|
COMPARE_SCALAR_FIELD(requiredPerms);
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(checkAsUser);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
_equalSortClause(SortClause *a, SortClause *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(tleSortGroupRef);
|
|
|
|
COMPARE_SCALAR_FIELD(sortop);
|
2007-01-09 03:14:16 +01:00
|
|
|
COMPARE_SCALAR_FIELD(nulls_first);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-04-30 20:30:40 +02:00
|
|
|
static bool
|
|
|
|
_equalRowMarkClause(RowMarkClause *a, RowMarkClause *b)
|
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(rti);
|
|
|
|
COMPARE_SCALAR_FIELD(forUpdate);
|
|
|
|
COMPARE_SCALAR_FIELD(noWait);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalFkConstraint(FkConstraint *a, FkConstraint *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(constr_name);
|
|
|
|
COMPARE_NODE_FIELD(pktable);
|
|
|
|
COMPARE_NODE_FIELD(fk_attrs);
|
|
|
|
COMPARE_NODE_FIELD(pk_attrs);
|
|
|
|
COMPARE_SCALAR_FIELD(fk_matchtype);
|
|
|
|
COMPARE_SCALAR_FIELD(fk_upd_action);
|
|
|
|
COMPARE_SCALAR_FIELD(fk_del_action);
|
|
|
|
COMPARE_SCALAR_FIELD(deferrable);
|
|
|
|
COMPARE_SCALAR_FIELD(initdeferred);
|
|
|
|
COMPARE_SCALAR_FIELD(skip_validation);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-02-03 15:06:56 +01:00
|
|
|
static bool
|
2007-11-15 23:25:18 +01:00
|
|
|
_equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
|
2007-02-03 15:06:56 +01:00
|
|
|
{
|
|
|
|
COMPARE_SCALAR_FIELD(xmloption);
|
|
|
|
COMPARE_NODE_FIELD(expr);
|
|
|
|
COMPARE_NODE_FIELD(typename);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
/*
|
|
|
|
* Stuff from pg_list.h
|
|
|
|
*/
|
2002-11-25 04:33:27 +01:00
|
|
|
|
2004-05-26 06:41:50 +02:00
|
|
|
static bool
|
|
|
|
_equalList(List *a, List *b)
|
|
|
|
{
|
2004-08-29 07:07:03 +02:00
|
|
|
ListCell *item_a;
|
|
|
|
ListCell *item_b;
|
2004-05-26 06:41:50 +02:00
|
|
|
|
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* Try to reject by simple scalar checks before grovelling through all the
|
|
|
|
* list elements...
|
2004-05-26 06:41:50 +02:00
|
|
|
*/
|
|
|
|
COMPARE_SCALAR_FIELD(type);
|
|
|
|
COMPARE_SCALAR_FIELD(length);
|
|
|
|
|
|
|
|
/*
|
2005-10-15 04:49:52 +02:00
|
|
|
* We place the switch outside the loop for the sake of efficiency; this
|
|
|
|
* may not be worth doing...
|
2004-05-26 06:41:50 +02:00
|
|
|
*/
|
|
|
|
switch (a->type)
|
|
|
|
{
|
|
|
|
case T_List:
|
|
|
|
forboth(item_a, a, item_b, b)
|
|
|
|
{
|
|
|
|
if (!equal(lfirst(item_a), lfirst(item_b)))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case T_IntList:
|
|
|
|
forboth(item_a, a, item_b, b)
|
|
|
|
{
|
|
|
|
if (lfirst_int(item_a) != lfirst_int(item_b))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case T_OidList:
|
|
|
|
forboth(item_a, a, item_b, b)
|
|
|
|
{
|
|
|
|
if (lfirst_oid(item_a) != lfirst_oid(item_b))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
elog(ERROR, "unrecognized list node type: %d",
|
|
|
|
(int) a->type);
|
|
|
|
return false; /* keep compiler quiet */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we got here, we should have run out of elements of both lists
|
|
|
|
*/
|
|
|
|
Assert(item_a == NULL);
|
|
|
|
Assert(item_b == NULL);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Stuff from value.h
|
|
|
|
*/
|
|
|
|
|
2000-08-12 01:45:35 +02:00
|
|
|
static bool
|
|
|
|
_equalValue(Value *a, Value *b)
|
|
|
|
{
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(type);
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
switch (a->type)
|
|
|
|
{
|
|
|
|
case T_Integer:
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_SCALAR_FIELD(val.ival);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_Float:
|
|
|
|
case T_String:
|
2000-10-31 11:22:13 +01:00
|
|
|
case T_BitString:
|
2002-11-25 04:33:27 +01:00
|
|
|
COMPARE_STRING_FIELD(val.str);
|
|
|
|
break;
|
2002-08-19 02:11:53 +02:00
|
|
|
case T_Null:
|
|
|
|
/* nothing to do */
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
default:
|
2003-07-23 01:30:39 +02:00
|
|
|
elog(ERROR, "unrecognized node type: %d", (int) a->type);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* equal
|
|
|
|
* returns whether two nodes are equal
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
equal(void *a, void *b)
|
|
|
|
{
|
2003-07-23 01:30:39 +02:00
|
|
|
bool retval;
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
if (a == b)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* note that a!=b, so only one of them can be NULL
|
|
|
|
*/
|
|
|
|
if (a == NULL || b == NULL)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* are they the same type of nodes?
|
|
|
|
*/
|
|
|
|
if (nodeTag(a) != nodeTag(b))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
switch (nodeTag(a))
|
|
|
|
{
|
2003-08-04 02:43:34 +02:00
|
|
|
/*
|
|
|
|
* PRIMITIVE NODES
|
|
|
|
*/
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_Alias:
|
|
|
|
retval = _equalAlias(a, b);
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_RangeVar:
|
|
|
|
retval = _equalRangeVar(a, b);
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
2007-02-20 18:32:18 +01:00
|
|
|
case T_IntoClause:
|
|
|
|
retval = _equalIntoClause(a, b);
|
|
|
|
break;
|
1997-09-08 04:41:22 +02:00
|
|
|
case T_Var:
|
|
|
|
retval = _equalVar(a, b);
|
|
|
|
break;
|
|
|
|
case T_Const:
|
|
|
|
retval = _equalConst(a, b);
|
|
|
|
break;
|
|
|
|
case T_Param:
|
|
|
|
retval = _equalParam(a, b);
|
|
|
|
break;
|
1999-06-06 19:46:40 +02:00
|
|
|
case T_Aggref:
|
|
|
|
retval = _equalAggref(a, b);
|
1999-09-26 04:28:44 +02:00
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_ArrayRef:
|
|
|
|
retval = _equalArrayRef(a, b);
|
|
|
|
break;
|
|
|
|
case T_FuncExpr:
|
|
|
|
retval = _equalFuncExpr(a, b);
|
|
|
|
break;
|
|
|
|
case T_OpExpr:
|
|
|
|
retval = _equalOpExpr(a, b);
|
|
|
|
break;
|
|
|
|
case T_DistinctExpr:
|
|
|
|
retval = _equalDistinctExpr(a, b);
|
|
|
|
break;
|
2003-06-29 02:33:44 +02:00
|
|
|
case T_ScalarArrayOpExpr:
|
|
|
|
retval = _equalScalarArrayOpExpr(a, b);
|
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_BoolExpr:
|
|
|
|
retval = _equalBoolExpr(a, b);
|
|
|
|
break;
|
1999-09-26 04:28:44 +02:00
|
|
|
case T_SubLink:
|
|
|
|
retval = _equalSubLink(a, b);
|
1999-06-06 19:46:40 +02:00
|
|
|
break;
|
2002-12-14 01:17:59 +01:00
|
|
|
case T_SubPlan:
|
|
|
|
retval = _equalSubPlan(a, b);
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_FieldSelect:
|
|
|
|
retval = _equalFieldSelect(a, b);
|
|
|
|
break;
|
2004-06-09 21:08:20 +02:00
|
|
|
case T_FieldStore:
|
|
|
|
retval = _equalFieldStore(a, b);
|
|
|
|
break;
|
2000-06-29 09:35:57 +02:00
|
|
|
case T_RelabelType:
|
|
|
|
retval = _equalRelabelType(a, b);
|
|
|
|
break;
|
2007-06-05 23:31:09 +02:00
|
|
|
case T_CoerceViaIO:
|
|
|
|
retval = _equalCoerceViaIO(a, b);
|
|
|
|
break;
|
2007-03-28 01:21:12 +02:00
|
|
|
case T_ArrayCoerceExpr:
|
|
|
|
retval = _equalArrayCoerceExpr(a, b);
|
|
|
|
break;
|
2004-12-12 00:26:51 +01:00
|
|
|
case T_ConvertRowtypeExpr:
|
|
|
|
retval = _equalConvertRowtypeExpr(a, b);
|
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_CaseExpr:
|
|
|
|
retval = _equalCaseExpr(a, b);
|
|
|
|
break;
|
|
|
|
case T_CaseWhen:
|
|
|
|
retval = _equalCaseWhen(a, b);
|
|
|
|
break;
|
2004-03-17 21:48:43 +01:00
|
|
|
case T_CaseTestExpr:
|
|
|
|
retval = _equalCaseTestExpr(a, b);
|
|
|
|
break;
|
2003-04-09 01:20:04 +02:00
|
|
|
case T_ArrayExpr:
|
|
|
|
retval = _equalArrayExpr(a, b);
|
|
|
|
break;
|
2004-05-11 00:44:49 +02:00
|
|
|
case T_RowExpr:
|
|
|
|
retval = _equalRowExpr(a, b);
|
|
|
|
break;
|
2005-12-28 02:30:02 +01:00
|
|
|
case T_RowCompareExpr:
|
|
|
|
retval = _equalRowCompareExpr(a, b);
|
|
|
|
break;
|
2003-02-16 03:30:39 +01:00
|
|
|
case T_CoalesceExpr:
|
|
|
|
retval = _equalCoalesceExpr(a, b);
|
|
|
|
break;
|
2005-06-27 00:05:42 +02:00
|
|
|
case T_MinMaxExpr:
|
|
|
|
retval = _equalMinMaxExpr(a, b);
|
|
|
|
break;
|
2006-12-24 01:29:20 +01:00
|
|
|
case T_XmlExpr:
|
|
|
|
retval = _equalXmlExpr(a, b);
|
|
|
|
break;
|
2003-02-16 03:30:39 +01:00
|
|
|
case T_NullIfExpr:
|
|
|
|
retval = _equalNullIfExpr(a, b);
|
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_NullTest:
|
|
|
|
retval = _equalNullTest(a, b);
|
|
|
|
break;
|
|
|
|
case T_BooleanTest:
|
|
|
|
retval = _equalBooleanTest(a, b);
|
|
|
|
break;
|
2003-02-03 22:15:45 +01:00
|
|
|
case T_CoerceToDomain:
|
|
|
|
retval = _equalCoerceToDomain(a, b);
|
2002-12-12 16:49:42 +01:00
|
|
|
break;
|
2003-02-03 22:15:45 +01:00
|
|
|
case T_CoerceToDomainValue:
|
|
|
|
retval = _equalCoerceToDomainValue(a, b);
|
2002-12-12 16:49:42 +01:00
|
|
|
break;
|
2003-07-03 18:34:26 +02:00
|
|
|
case T_SetToDefault:
|
|
|
|
retval = _equalSetToDefault(a, b);
|
|
|
|
break;
|
2007-06-11 03:16:30 +02:00
|
|
|
case T_CurrentOfExpr:
|
|
|
|
retval = _equalCurrentOfExpr(a, b);
|
|
|
|
break;
|
2002-12-12 16:49:42 +01:00
|
|
|
case T_TargetEntry:
|
|
|
|
retval = _equalTargetEntry(a, b);
|
|
|
|
break;
|
2000-09-12 23:07:18 +02:00
|
|
|
case T_RangeTblRef:
|
|
|
|
retval = _equalRangeTblRef(a, b);
|
|
|
|
break;
|
2000-09-29 20:21:41 +02:00
|
|
|
case T_FromExpr:
|
|
|
|
retval = _equalFromExpr(a, b);
|
|
|
|
break;
|
2000-09-12 23:07:18 +02:00
|
|
|
case T_JoinExpr:
|
|
|
|
retval = _equalJoinExpr(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
/*
|
|
|
|
* RELATION NODES
|
|
|
|
*/
|
2007-01-20 21:45:41 +01:00
|
|
|
case T_PathKey:
|
|
|
|
retval = _equalPathKey(a, b);
|
1999-11-23 21:07:06 +01:00
|
|
|
break;
|
2000-06-29 09:35:57 +02:00
|
|
|
case T_RestrictInfo:
|
|
|
|
retval = _equalRestrictInfo(a, b);
|
1998-02-13 04:27:47 +01:00
|
|
|
break;
|
2005-12-20 03:30:36 +01:00
|
|
|
case T_OuterJoinInfo:
|
|
|
|
retval = _equalOuterJoinInfo(a, b);
|
|
|
|
break;
|
2003-01-20 19:55:07 +01:00
|
|
|
case T_InClauseInfo:
|
|
|
|
retval = _equalInClauseInfo(a, b);
|
|
|
|
break;
|
2006-01-31 22:39:25 +01:00
|
|
|
case T_AppendRelInfo:
|
|
|
|
retval = _equalAppendRelInfo(a, b);
|
|
|
|
break;
|
1997-09-08 04:41:22 +02:00
|
|
|
case T_List:
|
2004-05-26 06:41:50 +02:00
|
|
|
case T_IntList:
|
|
|
|
case T_OidList:
|
|
|
|
retval = _equalList(a, b);
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
2002-08-19 02:11:53 +02:00
|
|
|
|
2000-06-29 09:35:57 +02:00
|
|
|
case T_Integer:
|
|
|
|
case T_Float:
|
|
|
|
case T_String:
|
2000-10-31 11:22:13 +01:00
|
|
|
case T_BitString:
|
2002-08-19 02:11:53 +02:00
|
|
|
case T_Null:
|
2000-06-29 09:35:57 +02:00
|
|
|
retval = _equalValue(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
|
2002-12-12 16:49:42 +01:00
|
|
|
/*
|
|
|
|
* PARSE NODES
|
|
|
|
*/
|
1999-02-07 01:52:12 +01:00
|
|
|
case T_Query:
|
|
|
|
retval = _equalQuery(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_InsertStmt:
|
|
|
|
retval = _equalInsertStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DeleteStmt:
|
|
|
|
retval = _equalDeleteStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_UpdateStmt:
|
|
|
|
retval = _equalUpdateStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_SelectStmt:
|
|
|
|
retval = _equalSelectStmt(a, b);
|
|
|
|
break;
|
2000-10-05 21:11:39 +02:00
|
|
|
case T_SetOperationStmt:
|
|
|
|
retval = _equalSetOperationStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_AlterTableStmt:
|
|
|
|
retval = _equalAlterTableStmt(a, b);
|
|
|
|
break;
|
2004-05-05 06:48:48 +02:00
|
|
|
case T_AlterTableCmd:
|
|
|
|
retval = _equalAlterTableCmd(a, b);
|
|
|
|
break;
|
2002-12-06 06:00:34 +01:00
|
|
|
case T_AlterDomainStmt:
|
|
|
|
retval = _equalAlterDomainStmt(a, b);
|
|
|
|
break;
|
2001-06-10 01:21:55 +02:00
|
|
|
case T_GrantStmt:
|
|
|
|
retval = _equalGrantStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
2005-06-28 07:09:14 +02:00
|
|
|
case T_GrantRoleStmt:
|
|
|
|
retval = _equalGrantRoleStmt(a, b);
|
|
|
|
break;
|
2003-03-10 04:53:52 +01:00
|
|
|
case T_DeclareCursorStmt:
|
|
|
|
retval = _equalDeclareCursorStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_ClosePortalStmt:
|
|
|
|
retval = _equalClosePortalStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ClusterStmt:
|
|
|
|
retval = _equalClusterStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CopyStmt:
|
|
|
|
retval = _equalCopyStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CreateStmt:
|
|
|
|
retval = _equalCreateStmt(a, b);
|
|
|
|
break;
|
2003-06-25 05:40:19 +02:00
|
|
|
case T_InhRelation:
|
2003-08-04 02:43:34 +02:00
|
|
|
retval = _equalInhRelation(a, b);
|
2003-06-25 05:40:19 +02:00
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_DefineStmt:
|
|
|
|
retval = _equalDefineStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DropStmt:
|
|
|
|
retval = _equalDropStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_TruncateStmt:
|
|
|
|
retval = _equalTruncateStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CommentStmt:
|
|
|
|
retval = _equalCommentStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_FetchStmt:
|
|
|
|
retval = _equalFetchStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_IndexStmt:
|
|
|
|
retval = _equalIndexStmt(a, b);
|
|
|
|
break;
|
2002-05-17 20:32:52 +02:00
|
|
|
case T_CreateFunctionStmt:
|
|
|
|
retval = _equalCreateFunctionStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
2004-01-07 00:55:19 +01:00
|
|
|
case T_FunctionParameter:
|
|
|
|
retval = _equalFunctionParameter(a, b);
|
|
|
|
break;
|
2005-03-14 01:19:37 +01:00
|
|
|
case T_AlterFunctionStmt:
|
|
|
|
retval = _equalAlterFunctionStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_RemoveFuncStmt:
|
|
|
|
retval = _equalRemoveFuncStmt(a, b);
|
|
|
|
break;
|
2002-07-30 00:14:11 +02:00
|
|
|
case T_RemoveOpClassStmt:
|
|
|
|
retval = _equalRemoveOpClassStmt(a, b);
|
|
|
|
break;
|
2007-01-23 06:07:18 +01:00
|
|
|
case T_RemoveOpFamilyStmt:
|
|
|
|
retval = _equalRemoveOpFamilyStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_RenameStmt:
|
|
|
|
retval = _equalRenameStmt(a, b);
|
|
|
|
break;
|
2005-08-01 06:03:59 +02:00
|
|
|
case T_AlterObjectSchemaStmt:
|
|
|
|
retval = _equalAlterObjectSchemaStmt(a, b);
|
|
|
|
break;
|
2004-06-25 23:55:59 +02:00
|
|
|
case T_AlterOwnerStmt:
|
|
|
|
retval = _equalAlterOwnerStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_RuleStmt:
|
|
|
|
retval = _equalRuleStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_NotifyStmt:
|
|
|
|
retval = _equalNotifyStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ListenStmt:
|
|
|
|
retval = _equalListenStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_UnlistenStmt:
|
|
|
|
retval = _equalUnlistenStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_TransactionStmt:
|
|
|
|
retval = _equalTransactionStmt(a, b);
|
|
|
|
break;
|
2002-08-15 18:36:08 +02:00
|
|
|
case T_CompositeTypeStmt:
|
|
|
|
retval = _equalCompositeTypeStmt(a, b);
|
|
|
|
break;
|
2007-04-02 05:49:42 +02:00
|
|
|
case T_CreateEnumStmt:
|
|
|
|
retval = _equalCreateEnumStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_ViewStmt:
|
|
|
|
retval = _equalViewStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_LoadStmt:
|
|
|
|
retval = _equalLoadStmt(a, b);
|
|
|
|
break;
|
2002-03-19 03:18:25 +01:00
|
|
|
case T_CreateDomainStmt:
|
|
|
|
retval = _equalCreateDomainStmt(a, b);
|
|
|
|
break;
|
2002-07-30 00:14:11 +02:00
|
|
|
case T_CreateOpClassStmt:
|
|
|
|
retval = _equalCreateOpClassStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CreateOpClassItem:
|
|
|
|
retval = _equalCreateOpClassItem(a, b);
|
|
|
|
break;
|
2007-01-23 06:07:18 +01:00
|
|
|
case T_CreateOpFamilyStmt:
|
|
|
|
retval = _equalCreateOpFamilyStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_AlterOpFamilyStmt:
|
|
|
|
retval = _equalAlterOpFamilyStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_CreatedbStmt:
|
|
|
|
retval = _equalCreatedbStmt(a, b);
|
|
|
|
break;
|
2005-07-31 19:19:22 +02:00
|
|
|
case T_AlterDatabaseStmt:
|
|
|
|
retval = _equalAlterDatabaseStmt(a, b);
|
|
|
|
break;
|
2002-03-01 23:45:19 +01:00
|
|
|
case T_AlterDatabaseSetStmt:
|
|
|
|
retval = _equalAlterDatabaseSetStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_DropdbStmt:
|
|
|
|
retval = _equalDropdbStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_VacuumStmt:
|
|
|
|
retval = _equalVacuumStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ExplainStmt:
|
|
|
|
retval = _equalExplainStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CreateSeqStmt:
|
|
|
|
retval = _equalCreateSeqStmt(a, b);
|
|
|
|
break;
|
2003-03-20 08:02:11 +01:00
|
|
|
case T_AlterSeqStmt:
|
|
|
|
retval = _equalAlterSeqStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_VariableSetStmt:
|
|
|
|
retval = _equalVariableSetStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_VariableShowStmt:
|
|
|
|
retval = _equalVariableShowStmt(a, b);
|
|
|
|
break;
|
2007-04-26 18:13:15 +02:00
|
|
|
case T_DiscardStmt:
|
|
|
|
retval = _equalDiscardStmt(a, b);
|
|
|
|
break;
|
2004-06-18 08:14:31 +02:00
|
|
|
case T_CreateTableSpaceStmt:
|
|
|
|
retval = _equalCreateTableSpaceStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DropTableSpaceStmt:
|
|
|
|
retval = _equalDropTableSpaceStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_CreateTrigStmt:
|
|
|
|
retval = _equalCreateTrigStmt(a, b);
|
|
|
|
break;
|
2002-04-18 22:01:11 +02:00
|
|
|
case T_DropPropertyStmt:
|
|
|
|
retval = _equalDropPropertyStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
|
|
|
case T_CreatePLangStmt:
|
|
|
|
retval = _equalCreatePLangStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DropPLangStmt:
|
|
|
|
retval = _equalDropPLangStmt(a, b);
|
|
|
|
break;
|
2005-06-28 07:09:14 +02:00
|
|
|
case T_CreateRoleStmt:
|
|
|
|
retval = _equalCreateRoleStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
2005-06-28 07:09:14 +02:00
|
|
|
case T_AlterRoleStmt:
|
|
|
|
retval = _equalAlterRoleStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
2005-06-28 07:09:14 +02:00
|
|
|
case T_AlterRoleSetStmt:
|
|
|
|
retval = _equalAlterRoleSetStmt(a, b);
|
2002-03-01 23:45:19 +01:00
|
|
|
break;
|
2005-06-28 07:09:14 +02:00
|
|
|
case T_DropRoleStmt:
|
|
|
|
retval = _equalDropRoleStmt(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
|
|
|
case T_LockStmt:
|
|
|
|
retval = _equalLockStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ConstraintsSetStmt:
|
|
|
|
retval = _equalConstraintsSetStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ReindexStmt:
|
|
|
|
retval = _equalReindexStmt(a, b);
|
|
|
|
break;
|
2000-11-05 23:50:21 +01:00
|
|
|
case T_CheckPointStmt:
|
|
|
|
retval = true;
|
|
|
|
break;
|
2002-03-21 17:02:16 +01:00
|
|
|
case T_CreateSchemaStmt:
|
|
|
|
retval = _equalCreateSchemaStmt(a, b);
|
|
|
|
break;
|
2002-08-19 02:11:53 +02:00
|
|
|
case T_CreateConversionStmt:
|
|
|
|
retval = _equalCreateConversionStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_CreateCastStmt:
|
|
|
|
retval = _equalCreateCastStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DropCastStmt:
|
|
|
|
retval = _equalDropCastStmt(a, b);
|
|
|
|
break;
|
2002-08-27 06:55:12 +02:00
|
|
|
case T_PrepareStmt:
|
|
|
|
retval = _equalPrepareStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_ExecuteStmt:
|
|
|
|
retval = _equalExecuteStmt(a, b);
|
|
|
|
break;
|
|
|
|
case T_DeallocateStmt:
|
|
|
|
retval = _equalDeallocateStmt(a, b);
|
|
|
|
break;
|
2005-11-21 13:49:33 +01:00
|
|
|
case T_DropOwnedStmt:
|
|
|
|
retval = _equalDropOwnedStmt(a, b);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_ReassignOwnedStmt:
|
|
|
|
retval = _equalReassignOwnedStmt(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
|
|
|
|
case T_A_Expr:
|
|
|
|
retval = _equalAExpr(a, b);
|
|
|
|
break;
|
2002-03-21 17:02:16 +01:00
|
|
|
case T_ColumnRef:
|
|
|
|
retval = _equalColumnRef(a, b);
|
|
|
|
break;
|
|
|
|
case T_ParamRef:
|
|
|
|
retval = _equalParamRef(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
|
|
|
case T_A_Const:
|
|
|
|
retval = _equalAConst(a, b);
|
|
|
|
break;
|
|
|
|
case T_FuncCall:
|
|
|
|
retval = _equalFuncCall(a, b);
|
|
|
|
break;
|
|
|
|
case T_A_Indices:
|
|
|
|
retval = _equalAIndices(a, b);
|
|
|
|
break;
|
2004-06-09 21:08:20 +02:00
|
|
|
case T_A_Indirection:
|
|
|
|
retval = _equalA_Indirection(a, b);
|
2002-03-21 17:02:16 +01:00
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_ResTarget:
|
|
|
|
retval = _equalResTarget(a, b);
|
|
|
|
break;
|
|
|
|
case T_TypeCast:
|
|
|
|
retval = _equalTypeCast(a, b);
|
|
|
|
break;
|
2003-08-17 21:58:06 +02:00
|
|
|
case T_SortBy:
|
|
|
|
retval = _equalSortBy(a, b);
|
2000-08-12 01:45:35 +02:00
|
|
|
break;
|
2000-09-12 23:07:18 +02:00
|
|
|
case T_RangeSubselect:
|
|
|
|
retval = _equalRangeSubselect(a, b);
|
|
|
|
break;
|
2002-05-12 22:10:05 +02:00
|
|
|
case T_RangeFunction:
|
|
|
|
retval = _equalRangeFunction(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_TypeName:
|
|
|
|
retval = _equalTypeName(a, b);
|
|
|
|
break;
|
|
|
|
case T_IndexElem:
|
|
|
|
retval = _equalIndexElem(a, b);
|
|
|
|
break;
|
|
|
|
case T_ColumnDef:
|
|
|
|
retval = _equalColumnDef(a, b);
|
|
|
|
break;
|
|
|
|
case T_Constraint:
|
|
|
|
retval = _equalConstraint(a, b);
|
|
|
|
break;
|
|
|
|
case T_DefElem:
|
|
|
|
retval = _equalDefElem(a, b);
|
|
|
|
break;
|
2005-08-01 22:31:16 +02:00
|
|
|
case T_LockingClause:
|
|
|
|
retval = _equalLockingClause(a, b);
|
|
|
|
break;
|
1999-02-07 01:52:12 +01:00
|
|
|
case T_RangeTblEntry:
|
|
|
|
retval = _equalRangeTblEntry(a, b);
|
|
|
|
break;
|
2000-01-31 02:21:39 +01:00
|
|
|
case T_SortClause:
|
|
|
|
retval = _equalSortClause(a, b);
|
|
|
|
break;
|
|
|
|
case T_GroupClause:
|
|
|
|
/* GroupClause is equivalent to SortClause */
|
|
|
|
retval = _equalSortClause(a, b);
|
|
|
|
break;
|
2006-04-30 20:30:40 +02:00
|
|
|
case T_RowMarkClause:
|
|
|
|
retval = _equalRowMarkClause(a, b);
|
|
|
|
break;
|
2000-08-12 01:45:35 +02:00
|
|
|
case T_FkConstraint:
|
|
|
|
retval = _equalFkConstraint(a, b);
|
|
|
|
break;
|
2001-06-10 01:21:55 +02:00
|
|
|
case T_PrivGrantee:
|
|
|
|
retval = _equalPrivGrantee(a, b);
|
|
|
|
break;
|
2002-02-19 00:11:58 +01:00
|
|
|
case T_FuncWithArgs:
|
|
|
|
retval = _equalFuncWithArgs(a, b);
|
|
|
|
break;
|
2007-02-03 15:06:56 +01:00
|
|
|
case T_XmlSerialize:
|
|
|
|
retval = _equalXmlSerialize(a, b);
|
|
|
|
break;
|
2000-06-29 09:35:57 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
default:
|
2003-07-23 01:30:39 +02:00
|
|
|
elog(ERROR, "unrecognized node type: %d",
|
|
|
|
(int) nodeTag(a));
|
|
|
|
retval = false; /* keep compiler quiet */
|
1997-09-08 04:41:22 +02:00
|
|
|
break;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|
1997-09-07 07:04:48 +02:00
|
|
|
|
|
|
|
return retval;
|
1996-07-09 08:22:35 +02:00
|
|
|
}
|