1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Add CREATE/ALTER/DROP OPERATOR FAMILY commands, also COMMENT ON OPERATOR

FAMILY; and add FAMILY option to CREATE OPERATOR CLASS to allow adding a
class to a pre-existing family.  Per previous discussion.  Man, what a
tedious lot of cutting and pasting ...
This commit is contained in:
Tom Lane
2007-01-23 05:07:18 +00:00
parent 8502b68513
commit a33cf1041f
22 changed files with 1981 additions and 90 deletions

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.363 2007/01/22 20:00:39 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.364 2007/01/23 05:07:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2158,6 +2158,19 @@ _copyRemoveOpClassStmt(RemoveOpClassStmt *from)
return newnode;
}
static RemoveOpFamilyStmt *
_copyRemoveOpFamilyStmt(RemoveOpFamilyStmt *from)
{
RemoveOpFamilyStmt *newnode = makeNode(RemoveOpFamilyStmt);
COPY_NODE_FIELD(opfamilyname);
COPY_STRING_FIELD(amname);
COPY_SCALAR_FIELD(behavior);
COPY_SCALAR_FIELD(missing_ok);
return newnode;
}
static RenameStmt *
_copyRenameStmt(RenameStmt *from)
{
@ -2332,11 +2345,36 @@ _copyCreateOpClassItem(CreateOpClassItem *from)
COPY_NODE_FIELD(args);
COPY_SCALAR_FIELD(number);
COPY_SCALAR_FIELD(recheck);
COPY_NODE_FIELD(class_args);
COPY_NODE_FIELD(storedtype);
return newnode;
}
static CreateOpFamilyStmt *
_copyCreateOpFamilyStmt(CreateOpFamilyStmt *from)
{
CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt);
COPY_NODE_FIELD(opfamilyname);
COPY_STRING_FIELD(amname);
return newnode;
}
static AlterOpFamilyStmt *
_copyAlterOpFamilyStmt(AlterOpFamilyStmt *from)
{
AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt);
COPY_NODE_FIELD(opfamilyname);
COPY_STRING_FIELD(amname);
COPY_SCALAR_FIELD(isDrop);
COPY_NODE_FIELD(items);
return newnode;
}
static CreatedbStmt *
_copyCreatedbStmt(CreatedbStmt *from)
{
@ -3163,6 +3201,9 @@ copyObject(void *from)
case T_RemoveOpClassStmt:
retval = _copyRemoveOpClassStmt(from);
break;
case T_RemoveOpFamilyStmt:
retval = _copyRemoveOpFamilyStmt(from);
break;
case T_RenameStmt:
retval = _copyRenameStmt(from);
break;
@ -3205,6 +3246,12 @@ copyObject(void *from)
case T_CreateOpClassItem:
retval = _copyCreateOpClassItem(from);
break;
case T_CreateOpFamilyStmt:
retval = _copyCreateOpFamilyStmt(from);
break;
case T_AlterOpFamilyStmt:
retval = _copyAlterOpFamilyStmt(from);
break;
case T_CreatedbStmt:
retval = _copyCreatedbStmt(from);
break;