]> granicus.if.org Git - postgresql/blob - src/include/catalog/heap.h
c68a5d4b50a9d00b8f1c8edcc4f00aa61c1f1aab
[postgresql] / src / include / catalog / heap.h
1 /*-------------------------------------------------------------------------
2  *
3  * heap.h
4  *        prototypes for functions in backend/catalog/heap.c
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: heap.h,v 1.41 2001/11/05 17:46:31 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef HEAP_H
15 #define HEAP_H
16
17 #include "catalog/pg_attribute.h"
18 #include "utils/rel.h"
19
20 typedef struct RawColumnDefault
21 {
22         AttrNumber      attnum;                 /* attribute to attach default to */
23         Node       *raw_default;        /* default value (untransformed parse
24                                                                  * tree) */
25 } RawColumnDefault;
26
27 extern Oid      RelnameFindRelid(const char *relname);
28
29 extern Relation heap_create(char *relname, TupleDesc tupDesc,
30                         bool istemp, bool storage_create,
31                         bool allow_system_table_mods);
32
33 extern void heap_storage_create(Relation rel);
34
35 extern Oid heap_create_with_catalog(char *relname, TupleDesc tupdesc,
36                                                  char relkind, bool relhasoids, bool istemp,
37                                                  bool allow_system_table_mods);
38
39 extern void heap_drop_with_catalog(const char *relname,
40                                            bool allow_system_table_mods);
41
42 extern void heap_truncate(char *relname);
43
44 extern void AddRelationRawConstraints(Relation rel,
45                                                   List *rawColDefaults,
46                                                   List *rawConstraints);
47
48 extern int      RemoveCheckConstraint(Relation rel, const char *constrName, bool inh);
49
50 extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno,
51                                                   bool relhasoids);
52
53 extern Form_pg_attribute SystemAttributeByName(const char *attname,
54                                           bool relhasoids);
55
56 #endif   /* HEAP_H */