From 35508d1cca1630e40b157d67b427174c3e1999aa Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 1 Aug 2005 04:03:59 +0000 Subject: Add ALTER object SET SCHEMA capability for a limited but useful set of object kinds (tables, functions, types). Documentation is not here yet. Original code by Bernd Helmle, extensive rework by Bruce Momjian and Tom Lane. --- src/include/commands/alter.h | 4 ++-- src/include/commands/defrem.h | 4 +++- src/include/commands/tablecmds.h | 9 ++++++++- src/include/commands/typecmds.h | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/include/commands') diff --git a/src/include/commands/alter.h b/src/include/commands/alter.h index 1a34030bff..33588bad32 100644 --- a/src/include/commands/alter.h +++ b/src/include/commands/alter.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/alter.h,v 1.6 2004/12/31 22:03:28 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/commands/alter.h,v 1.7 2005/08/01 04:03:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ #include "nodes/parsenodes.h" extern void ExecRenameStmt(RenameStmt *stmt); - +extern void ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt); extern void ExecAlterOwnerStmt(AlterOwnerStmt *stmt); #endif /* ALTER_H */ diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 10c3438065..a0f3dc67d6 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.66 2005/06/28 05:09:12 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.67 2005/08/01 04:03:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -55,6 +55,8 @@ extern void AlterFunction(AlterFunctionStmt *stmt); extern void CreateCast(CreateCastStmt *stmt); extern void DropCast(DropCastStmt *stmt); extern void DropCastById(Oid castOid); +extern void AlterFunctionNamespace(List *name, List *argtypes, + const char *newschema); /* commands/operatorcmds.c */ extern void DefineOperator(List *names, List *parameters); diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h index 5ec8c9a57d..582720df3b 100644 --- a/src/include/commands/tablecmds.h +++ b/src/include/commands/tablecmds.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.22 2005/01/27 03:18:24 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.23 2005/08/01 04:03:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -15,6 +15,7 @@ #define TABLECMDS_H #include "nodes/parsenodes.h" +#include "utils/rel.h" extern Oid DefineRelation(CreateStmt *stmt, char relkind); @@ -27,6 +28,12 @@ extern void AlterTableInternal(Oid relid, List *cmds, bool recurse); extern void AlterTableCreateToastTable(Oid relOid, bool silent); +extern void AlterTableNamespace(RangeVar *relation, const char *newschema); + +extern void AlterRelationNamespaceInternal(Relation classRel, Oid relOid, + Oid oldNspOid, Oid newNspOid, + bool hasDependEntry); + extern void ExecuteTruncate(List *relations); extern void renameatt(Oid myrelid, diff --git a/src/include/commands/typecmds.h b/src/include/commands/typecmds.h index a940a78f48..a070a27a29 100644 --- a/src/include/commands/typecmds.h +++ b/src/include/commands/typecmds.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/typecmds.h,v 1.11 2005/06/28 05:09:12 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/typecmds.h,v 1.12 2005/08/01 04:03:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,5 +35,8 @@ extern void AlterDomainDropConstraint(List *names, const char *constrName, extern List *GetDomainConstraints(Oid typeOid); extern void AlterTypeOwner(List *names, Oid newOwnerId); +extern void AlterTypeNamespace(List *names, const char *newschema); +extern void AlterTypeNamespaceInternal(Oid typeOid, Oid nspOid, + bool errorOnTableType); #endif /* TYPECMDS_H */ -- cgit v1.2.1