diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-29 22:14:11 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-07-29 22:14:11 +0000 |
commit | ea4686e3e1f00910a19e18dd59f5c518345bb431 (patch) | |
tree | 00359cabd37ad22e8228a5cc47a8600f45b74896 /src/backend/nodes/equalfuncs.c | |
parent | b9459c6adbf08abae7bbddb5c497476814823b7d (diff) |
Implement CREATE/DROP OPERATOR CLASS. Work still remains: need more
documentation (xindex.sgml should be rewritten), need to teach pg_dump
about it, need to update contrib modules that currently build pg_opclass
entries by hand. Original patch by Bill Studenmund, grammar adjustments
and general update for 7.3 by Tom Lane.
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 419313c6101..55beb563c8a 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -20,7 +20,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.144 2002/07/24 19:11:10 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.145 2002/07/29 22:14:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -976,6 +976,18 @@ _equalRemoveOperStmt(RemoveOperStmt *a, RemoveOperStmt *b) return true; } +static bool +_equalRemoveOpClassStmt(RemoveOpClassStmt *a, RemoveOpClassStmt *b) +{ + if (!equal(a->opclassname, b->opclassname)) + return false; + if (!equalstr(a->amname, b->amname)) + return false; + if (a->behavior != b->behavior) + return false; + + return true; +} static bool _equalRenameStmt(RenameStmt *a, RenameStmt *b) @@ -1083,6 +1095,42 @@ _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b) } static bool +_equalCreateOpClassStmt(CreateOpClassStmt *a, CreateOpClassStmt *b) +{ + if (!equal(a->opclassname, b->opclassname)) + return false; + if (!equalstr(a->amname, b->amname)) + return false; + if (!equal(a->datatype, b->datatype)) + return false; + if (!equal(a->items, b->items)) + return false; + if (a->isDefault != b->isDefault) + return false; + + return true; +} + +static bool +_equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b) +{ + if (a->itemtype != b->itemtype) + return false; + if (!equal(a->name, b->name)) + return false; + if (!equal(a->args, b->args)) + return false; + if (a->number != b->number) + return false; + if (a->recheck != b->recheck) + return false; + if (!equal(a->storedtype, b->storedtype)) + return false; + + return true; +} + +static bool _equalCreatedbStmt(CreatedbStmt *a, CreatedbStmt *b) { if (!equalstr(a->dbname, b->dbname)) @@ -2036,6 +2084,9 @@ equal(void *a, void *b) case T_RemoveOperStmt: retval = _equalRemoveOperStmt(a, b); break; + case T_RemoveOpClassStmt: + retval = _equalRemoveOpClassStmt(a, b); + break; case T_RenameStmt: retval = _equalRenameStmt(a, b); break; @@ -2063,6 +2114,12 @@ equal(void *a, void *b) case T_CreateDomainStmt: retval = _equalCreateDomainStmt(a, b); break; + case T_CreateOpClassStmt: + retval = _equalCreateOpClassStmt(a, b); + break; + case T_CreateOpClassItem: + retval = _equalCreateOpClassItem(a, b); + break; case T_CreatedbStmt: retval = _equalCreatedbStmt(a, b); break; |