1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-13 12:22:55 +03:00

ALTER DOMAIN .. SET / DROP NOT NULL

ALTER DOMAIN .. SET / DROP DEFAULT
ALTER DOMAIN .. ADD / DROP CONSTRAINT

New files:
- doc/src/sgml/ref/alter_domain.sgml

Rod Taylor
This commit is contained in:
Bruce Momjian
2002-12-06 03:28:34 +00:00
parent 36580c8e21
commit 853153ca6d
22 changed files with 1527 additions and 263 deletions

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.134 2002/09/24 21:26:44 tgl Exp $
* $Id: pg_type.h,v 1.135 2002/12/06 03:28:33 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -550,7 +550,7 @@ extern Oid TypeCreate(const char *typeName,
Oid elementType,
Oid baseType,
const char *defaultTypeValue,
const char *defaultTypeBin,
char *defaultTypeBin,
bool passedByValue,
char alignment,
char storage,
@@ -558,6 +558,18 @@ extern Oid TypeCreate(const char *typeName,
int32 typNDims,
bool typeNotNull);
extern void
GenerateTypeDependencies(Oid typeNamespace,
Oid typeObjectId,
Oid relationOid, /* only for 'c'atalog typeType */
char relationKind,
Oid inputProcedure,
Oid outputProcedure,
Oid elementType,
Oid baseType,
char *defaultTypeBin, /* cooked rep */
bool rebuild);
extern void TypeRename(const char *oldTypeName, Oid typeNamespace,
const char *newTypeName);

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: defrem.h,v 1.46 2002/09/21 18:39:26 tgl Exp $
* $Id: defrem.h,v 1.47 2002/12/06 03:28:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -52,14 +52,6 @@ extern void RemoveOperatorById(Oid operOid);
extern void DefineAggregate(List *names, List *parameters);
extern void RemoveAggregate(RemoveAggrStmt *stmt);
/* commands/typecmds.c */
extern void DefineType(List *names, List *parameters);
extern void RemoveType(List *names, DropBehavior behavior);
extern void RemoveTypeById(Oid typeOid);
extern void DefineDomain(CreateDomainStmt *stmt);
extern void RemoveDomain(List *names, DropBehavior behavior);
extern Oid DefineCompositeType(const RangeVar *typevar, List *coldeflist);
/* commands/opclasscmds.c */
extern void DefineOpClass(CreateOpClassStmt *stmt);
extern void RemoveOpClass(RemoveOpClassStmt *stmt);

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.126 2002/12/05 15:50:38 tgl Exp $
* $Id: nodes.h,v 1.127 2002/12/06 03:28:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -157,6 +157,7 @@ typedef enum NodeTag
T_UpdateStmt,
T_SelectStmt,
T_AlterTableStmt,
T_AlterDomainStmt,
T_SetOperationStmt,
T_GrantStmt,
T_ClosePortalStmt,

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.218 2002/11/25 03:36:50 tgl Exp $
* $Id: parsenodes.h,v 1.219 2002/12/06 03:28:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -827,6 +827,33 @@ typedef struct AlterTableStmt
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
} AlterTableStmt;
/* ----------------------
* Alter Domain
*
* The fields are used in different ways by the different variants of
* this command. Subtypes should match AlterTable subtypes
* ----------------------
*/
typedef struct AlterDomainStmt
{
NodeTag type;
char subtype; /*------------
* T = alter column default
* N = alter column drop not null
* O = alter column set not null
* C = add constraint
* X = drop constraint
* U = change owner
*------------
*/
List *typename; /* table to work on */
char *name; /* column or constraint name to act on, or
* new owner */
Node *def; /* definition of default or constraint */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
} AlterDomainStmt;
/* ----------------------
* Grant|Revoke Statement
* ----------------------