diff options
author | Tom Lane | 2002-04-15 05:22:04 +0000 |
---|---|---|
committer | Tom Lane | 2002-04-15 05:22:04 +0000 |
commit | 71dc300a375f4932693b064b161a400448c9bc2e (patch) | |
tree | ab20c095125a6eab33644befd187f936cf4fd093 /src/include | |
parent | ab1ead6b9761531787c78e0c80daf98b421ac06f (diff) |
The contents of command.c, creatinh.c, define.c, remove.c and rename.c
have been divided according to the type of object manipulated - so ALTER
TABLE code is in tablecmds.c, aggregate commands in aggregatecmds.c and
so on.
A few common support routines remain in define.c (prototypes in
src/include/commands/defrem.h).
No code has been changed except for includes to reflect the new files.
The prototypes for aggregatecmds.c, functioncmds.c, operatorcmds.c,
and typecmds.c remain in src/include/commands/defrem.h.
From John Gray <[email protected]>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/commands/command.h | 81 | ||||
-rw-r--r-- | src/include/commands/creatinh.h | 23 | ||||
-rw-r--r-- | src/include/commands/defrem.h | 35 | ||||
-rw-r--r-- | src/include/commands/lockcmds.h | 24 | ||||
-rw-r--r-- | src/include/commands/portalcmds.h | 39 | ||||
-rw-r--r-- | src/include/commands/rename.h | 25 | ||||
-rw-r--r-- | src/include/commands/schemacmds.h | 22 | ||||
-rw-r--r-- | src/include/commands/tablecmds.h | 63 |
8 files changed, 172 insertions, 140 deletions
diff --git a/src/include/commands/command.h b/src/include/commands/command.h deleted file mode 100644 index cfb8f20890e..00000000000 --- a/src/include/commands/command.h +++ /dev/null @@ -1,81 +0,0 @@ -/*------------------------------------------------------------------------- - * - * command.h - * prototypes for command.c. - * - * - * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: command.h,v 1.37 2002/04/01 04:35:39 tgl Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef COMMAND_H -#define COMMAND_H - -#include "utils/portal.h" - - -/* - * PerformPortalFetch - * Performs the POSTQUEL function FETCH. Fetches count (or all if 0) - * tuples in portal with name in the forward direction iff goForward. - * - * Exceptions: - * BadArg if forward invalid. - * "ERROR" if portal not found. - */ -extern void PerformPortalFetch(char *name, bool forward, int count, - CommandDest dest, char *completionTag); - -/* - * PerformPortalClose - * Performs the POSTQUEL function CLOSE. - */ -extern void PerformPortalClose(char *name, CommandDest dest); - -extern void PortalCleanup(Portal portal); - -/* - * ALTER TABLE variants - */ -extern void AlterTableAddColumn(Oid myrelid, bool inherits, ColumnDef *colDef); - -extern void AlterTableAlterColumnDefault(Oid myrelid, bool inh, - const char *colName, Node *newDefault); - -extern void AlterTableAlterColumnDropNotNull(Oid myrelid, - bool inh, const char *colName); - -extern void AlterTableAlterColumnSetNotNull(Oid myrelid, - bool inh, const char *colName); - -extern void AlterTableAlterColumnFlags(Oid myrelid, - bool inh, const char *colName, - Node *flagValue, const char *flagType); - -extern void AlterTableDropColumn(Oid myrelid, bool inh, - const char *colName, int behavior); - -extern void AlterTableAddConstraint(Oid myrelid, - bool inh, List *newConstraints); - -extern void AlterTableDropConstraint(Oid myrelid, - bool inh, const char *constrName, int behavior); - -extern void AlterTableCreateToastTable(Oid relOid, bool silent); - -extern void AlterTableOwner(Oid relationOid, int32 newOwnerSysId); - -/* - * LOCK - */ -extern void LockTableCommand(LockStmt *lockstmt); - -/* - * SCHEMA - */ -extern void CreateSchemaCommand(CreateSchemaStmt *parsetree); - -#endif /* COMMAND_H */ diff --git a/src/include/commands/creatinh.h b/src/include/commands/creatinh.h deleted file mode 100644 index fe0f2bc3512..00000000000 --- a/src/include/commands/creatinh.h +++ /dev/null @@ -1,23 +0,0 @@ -/*------------------------------------------------------------------------- - * - * creatinh.h - * prototypes for creatinh.c. - * - * - * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: creatinh.h,v 1.20 2002/03/29 19:06:22 tgl Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef CREATINH_H -#define CREATINH_H - -#include "nodes/parsenodes.h" - -extern Oid DefineRelation(CreateStmt *stmt, char relkind); -extern void RemoveRelation(const RangeVar *relation); -extern void TruncateRelation(const RangeVar *relation); - -#endif /* CREATINH_H */ diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h index 83b8fec6d77..711bc91f579 100644 --- a/src/include/commands/defrem.h +++ b/src/include/commands/defrem.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: defrem.h,v 1.34 2002/04/09 20:35:54 tgl Exp $ + * $Id: defrem.h,v 1.35 2002/04/15 05:22:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,8 @@ #include "nodes/parsenodes.h" +#define DEFAULT_TYPDELIM ',' + /* * prototypes in indexcmds.c */ @@ -33,22 +35,33 @@ extern void ReindexTable(RangeVar *relation, bool force); extern void ReindexDatabase(const char *databaseName, bool force, bool all); /* - * prototypes in define.c + * DefineFoo and RemoveFoo are now both in foocmds.c */ + extern void CreateFunction(ProcedureStmt *stmt); +extern void RemoveFunction(List *functionName, List *argTypes); + extern void DefineOperator(List *names, List *parameters); +extern void RemoveOperator(char *operatorName, + TypeName *typeName1, TypeName *typeName2); + extern void DefineAggregate(List *names, List *parameters); +extern void RemoveAggregate(List *aggName, TypeName *aggType); + extern void DefineType(List *names, List *parameters); +extern void RemoveType(List *names); extern void DefineDomain(CreateDomainStmt *stmt); - -/* - * prototypes in remove.c - */ extern void RemoveDomain(List *names, int behavior); -extern void RemoveFunction(List *functionName, List *argTypes); -extern void RemoveOperator(char *operatorName, - TypeName *typeName1, TypeName *typeName2); -extern void RemoveType(List *names); -extern void RemoveAggregate(List *aggName, TypeName *aggType); + + +/* support routines in define.c */ + +extern void case_translate_language_name(const char *input, char *output); + +extern char *defGetString(DefElem *def); +extern double defGetNumeric(DefElem *def); +extern List *defGetQualifiedName(DefElem *def); +extern TypeName *defGetTypeName(DefElem *def); +extern int defGetTypeLength(DefElem *def); #endif /* DEFREM_H */ diff --git a/src/include/commands/lockcmds.h b/src/include/commands/lockcmds.h new file mode 100644 index 00000000000..04335c31c4e --- /dev/null +++ b/src/include/commands/lockcmds.h @@ -0,0 +1,24 @@ +/*------------------------------------------------------------------------- + * + * lockcmds.h + * prototypes for lockcmds.c. + * + * + * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $Id: lockcmds.h,v 1.1 2002/04/15 05:22:03 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef LOCKCMDS_H +#define LOCKCMDS_H + +#include "nodes/parsenodes.h" + +/* + * LOCK + */ +extern void LockTableCommand(LockStmt *lockstmt); + +#endif /* LOCKCMDS_H */ diff --git a/src/include/commands/portalcmds.h b/src/include/commands/portalcmds.h new file mode 100644 index 00000000000..b62e3638a91 --- /dev/null +++ b/src/include/commands/portalcmds.h @@ -0,0 +1,39 @@ +/*------------------------------------------------------------------------- + * + * portalcmds.h + * prototypes for portalcmds.c. + * + * + * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $Id: portalcmds.h,v 1.1 2002/04/15 05:22:03 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef PORTALCMDS_H +#define PORTALCMDS_H + +#include "utils/portal.h" + +/* + * PerformPortalFetch + * Performs the POSTQUEL function FETCH. Fetches count (or all if 0) + * tuples in portal with name in the forward direction iff goForward. + * + * Exceptions: + * BadArg if forward invalid. + * "ERROR" if portal not found. + */ +extern void PerformPortalFetch(char *name, bool forward, int count, + CommandDest dest, char *completionTag); + +/* + * PerformPortalClose + * Performs the POSTQUEL function CLOSE. + */ +extern void PerformPortalClose(char *name, CommandDest dest); + +extern void PortalCleanup(Portal portal); + +#endif /* PORTALCMDS_H */ diff --git a/src/include/commands/rename.h b/src/include/commands/rename.h deleted file mode 100644 index 48e1a1cbe0d..00000000000 --- a/src/include/commands/rename.h +++ /dev/null @@ -1,25 +0,0 @@ -/*------------------------------------------------------------------------- - * - * rename.h - * - * - * - * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: rename.h,v 1.16 2002/03/31 07:49:30 tgl Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef RENAME_H -#define RENAME_H - -extern void renameatt(Oid relid, - const char *oldattname, - const char *newattname, - bool recurse); - -extern void renamerel(Oid relid, - const char *newrelname); - -#endif /* RENAME_H */ diff --git a/src/include/commands/schemacmds.h b/src/include/commands/schemacmds.h new file mode 100644 index 00000000000..6adf9a4517e --- /dev/null +++ b/src/include/commands/schemacmds.h @@ -0,0 +1,22 @@ +/*------------------------------------------------------------------------- + * + * schemacmds.h + * prototypes for schemacmds.c. + * + * + * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $Id: schemacmds.h,v 1.1 2002/04/15 05:22:04 tgl Exp $ + * + *------------------------------------------------------------------------- + */ + +#ifndef SCHEMACMDS_H +#define SCHEMACMDS_H + +#include "nodes/parsenodes.h" + +extern void CreateSchemaCommand(CreateSchemaStmt *parsetree); + +#endif /* SCHEMACMDS_H */ diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h new file mode 100644 index 00000000000..5d895972f5b --- /dev/null +++ b/src/include/commands/tablecmds.h @@ -0,0 +1,63 @@ +/*------------------------------------------------------------------------- + * + * tablecmds.h + * prototypes for tablecmds.c. + * + * + * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * $Id: tablecmds.h,v 1.1 2002/04/15 05:22:04 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef TABLECMDS_H +#define TABLECMDS_H + +#include "nodes/parsenodes.h" + +extern void AlterTableAddColumn(Oid myrelid, bool inherits, + ColumnDef *colDef); + +extern void AlterTableAlterColumnDefault(Oid myrelid, bool inh, + const char *colName, + Node *newDefault); + +extern void AlterTableAlterColumnDropNotNull(Oid myrelid, bool inh, + const char *colName); + +extern void AlterTableAlterColumnSetNotNull(Oid myrelid, bool inh, + const char *colName); + +extern void AlterTableAlterColumnFlags(Oid myrelid, bool inh, + const char *colName, + Node *flagValue, const char *flagType); + +extern void AlterTableDropColumn(Oid myrelid, bool inh, + const char *colName, int behavior); + +extern void AlterTableAddConstraint(Oid myrelid, bool inh, + List *newConstraints); + +extern void AlterTableDropConstraint(Oid myrelid, bool inh, + const char *constrName, int behavior); + +extern void AlterTableCreateToastTable(Oid relOid, bool silent); + +extern void AlterTableOwner(Oid relationOid, int32 newOwnerSysId); + +extern Oid DefineRelation(CreateStmt *stmt, char relkind); + +extern void RemoveRelation(const RangeVar *relation); + +extern void TruncateRelation(const RangeVar *relation); + +extern void renameatt(Oid relid, + const char *oldattname, + const char *newattname, + bool recurse); + +extern void renamerel(Oid relid, + const char *newrelname); + +#endif /* TABLECMDS_H */ |