1/*-------------------------------------------------------------------------
2 *
3 * typecmds.h
4 * prototypes for typecmds.c.
5 *
6 *
7 * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/include/commands/typecmds.h
11 *
12 *-------------------------------------------------------------------------
13 */
14#ifndef TYPECMDS_H
15#define TYPECMDS_H
16
17#include "access/htup.h"
18#include "catalog/dependency.h"
19#include "nodes/parsenodes.h"
20
21
22#define DEFAULT_TYPDELIM ','
23
24extern ObjectAddress DefineType(ParseState *pstate, List *names, List *parameters);
25extern void RemoveTypeById(Oid typeOid);
26extern ObjectAddress DefineDomain(CreateDomainStmt *stmt);
27extern ObjectAddress DefineEnum(CreateEnumStmt *stmt);
28extern ObjectAddress DefineRange(CreateRangeStmt *stmt);
29extern ObjectAddress AlterEnum(AlterEnumStmt *stmt);
30extern ObjectAddress DefineCompositeType(RangeVar *typevar, List *coldeflist);
31extern Oid AssignTypeArrayOid(void);
32
33extern ObjectAddress AlterDomainDefault(List *names, Node *defaultRaw);
34extern ObjectAddress AlterDomainNotNull(List *names, bool notNull);
35extern ObjectAddress AlterDomainAddConstraint(List *names, Node *constr,
36 ObjectAddress *constrAddr);
37extern ObjectAddress AlterDomainValidateConstraint(List *names, const char *constrName);
38extern ObjectAddress AlterDomainDropConstraint(List *names, const char *constrName,
39 DropBehavior behavior, bool missing_ok);
40
41extern void checkDomainOwner(HeapTuple tup);
42
43extern ObjectAddress RenameType(RenameStmt *stmt);
44
45extern ObjectAddress AlterTypeOwner(List *names, Oid newOwnerId, ObjectType objecttype);
46extern void AlterTypeOwner_oid(Oid typeOid, Oid newOwnerId, bool hasDependEntry);
47extern void AlterTypeOwnerInternal(Oid typeOid, Oid newOwnerId);
48
49extern ObjectAddress AlterTypeNamespace(List *names, const char *newschema,
50 ObjectType objecttype, Oid *oldschema);
51extern Oid AlterTypeNamespace_oid(Oid typeOid, Oid nspOid, ObjectAddresses *objsMoved);
52extern Oid AlterTypeNamespaceInternal(Oid typeOid, Oid nspOid,
53 bool isImplicitArray,
54 bool errorOnTableType,
55 ObjectAddresses *objsMoved);
56
57#endif /* TYPECMDS_H */
58