1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

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.
This commit is contained in:
Tom Lane
2002-07-29 22:14:11 +00:00
parent b9459c6adb
commit ea4686e3e1
26 changed files with 1697 additions and 373 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.197 2002/07/24 19:11:10 petere Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.198 2002/07/29 22:14:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2147,6 +2147,19 @@ _copyRemoveOperStmt(RemoveOperStmt *from)
return newnode;
}
static RemoveOpClassStmt *
_copyRemoveOpClassStmt(RemoveOpClassStmt *from)
{
RemoveOpClassStmt *newnode = makeNode(RemoveOpClassStmt);
Node_Copy(from, newnode, opclassname);
if (from->amname)
newnode->amname = pstrdup(from->amname);
newnode->behavior = from->behavior;
return newnode;
}
static RenameStmt *
_copyRenameStmt(RenameStmt *from)
{
@ -2252,6 +2265,36 @@ _copyCreateDomainStmt(CreateDomainStmt *from)
return newnode;
}
static CreateOpClassStmt *
_copyCreateOpClassStmt(CreateOpClassStmt *from)
{
CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt);
Node_Copy(from, newnode, opclassname);
if (from->amname)
newnode->amname = pstrdup(from->amname);
Node_Copy(from, newnode, datatype);
Node_Copy(from, newnode, items);
newnode->isDefault = from->isDefault;
return newnode;
}
static CreateOpClassItem *
_copyCreateOpClassItem(CreateOpClassItem *from)
{
CreateOpClassItem *newnode = makeNode(CreateOpClassItem);
newnode->itemtype = from->itemtype;
Node_Copy(from, newnode, name);
Node_Copy(from, newnode, args);
newnode->number = from->number;
newnode->recheck = from->recheck;
Node_Copy(from, newnode, storedtype);
return newnode;
}
static CreatedbStmt *
_copyCreatedbStmt(CreatedbStmt *from)
{
@ -2872,6 +2915,9 @@ copyObject(void *from)
case T_RemoveOperStmt:
retval = _copyRemoveOperStmt(from);
break;
case T_RemoveOpClassStmt:
retval = _copyRemoveOpClassStmt(from);
break;
case T_RenameStmt:
retval = _copyRenameStmt(from);
break;
@ -2899,6 +2945,12 @@ copyObject(void *from)
case T_CreateDomainStmt:
retval = _copyCreateDomainStmt(from);
break;
case T_CreateOpClassStmt:
retval = _copyCreateOpClassStmt(from);
break;
case T_CreateOpClassItem:
retval = _copyCreateOpClassItem(from);
break;
case T_CreatedbStmt:
retval = _copyCreatedbStmt(from);
break;