]> granicus.if.org Git - postgresql/blob - src/include/catalog/heap.h
Ok. Updated patch attached.
[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.42 2002/03/06 20:34:55 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef HEAP_H
15 #define HEAP_H
16
17 #include "catalog/pg_attribute.h"
18 #include "nodes/parsenodes.h"
19 #include "parser/parse_node.h"
20 #include "utils/rel.h"
21
22 typedef struct RawColumnDefault
23 {
24         AttrNumber      attnum;                 /* attribute to attach default to */
25         Node       *raw_default;        /* default value (untransformed parse
26                                                                  * tree) */
27 } RawColumnDefault;
28
29 extern Oid      RelnameFindRelid(const char *relname);
30
31 extern Relation heap_create(char *relname, TupleDesc tupDesc,
32                         bool istemp, bool storage_create,
33                         bool allow_system_table_mods);
34
35 extern void heap_storage_create(Relation rel);
36
37 extern Oid heap_create_with_catalog(char *relname, TupleDesc tupdesc,
38                                                  char relkind, bool relhasoids, bool istemp,
39                                                  bool allow_system_table_mods);
40
41 extern void heap_drop_with_catalog(const char *relname,
42                                            bool allow_system_table_mods);
43
44 extern void heap_truncate(char *relname);
45
46 extern void AddRelationRawConstraints(Relation rel,
47                                                   List *rawColDefaults,
48                                                   List *rawConstraints);
49
50 extern Node *cookDefault(ParseState *pstate
51                                                 , Node *raw_default
52                                                 , Oid atttypid
53                                                 , int32 atttypmod
54                                                 , char *attname);
55
56 extern int      RemoveCheckConstraint(Relation rel, const char *constrName, bool inh);
57
58 extern Form_pg_attribute SystemAttributeDefinition(AttrNumber attno,
59                                                   bool relhasoids);
60
61 extern Form_pg_attribute SystemAttributeByName(const char *attname,
62                                           bool relhasoids);
63
64 #endif   /* HEAP_H */