Skip to content

Commit 1054097

Browse files
committed
More cleanups of the include files
- centralizing to simplify the -I's required to compile
1 parent ca405ae commit 1054097

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+13489
-3
lines changed

src/include/access/funcindex.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: funcindex.h,v 1.1 1996/08/27 21:50:08 scrappy Exp $
9+
* $Id: funcindex.h,v 1.2 1996/08/28 01:56:16 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
1313
#ifndef _FUNC_INDEX_INCLUDED_
1414
#define _FUNC_INDEX_INCLUDED_
1515

16-
#include "postgres.h"
17-
1816
typedef struct {
1917
int nargs;
2018
Oid arglist[8];

src/include/catalog/catalog.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* catalog.h--
4+
* prototypes for functions in lib/catalog/catalog.c
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: catalog.h,v 1.1 1996/08/28 01:56:21 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef CATALOG_H
14+
#define CATALOG_H
15+
16+
#include "access/tupdesc.h"
17+
18+
extern char *relpath(char relname[]);
19+
extern bool IsSystemRelationName(char *relname);
20+
extern bool IsSharedSystemRelationName(char *relname);
21+
extern Oid newoid(void);
22+
extern void fillatt(TupleDesc att);
23+
24+
#endif /* CATALOG_H */

src/include/catalog/catname.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* catname.h--
4+
* POSTGRES system catalog relation name definitions.
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: catname.h,v 1.1 1996/08/28 01:56:23 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef CATNAME_H
14+
#define CATNAME_H
15+
16+
#include "postgres.h"
17+
18+
19+
#define AggregateRelationName "pg_aggregate"
20+
#define AccessMethodRelationName "pg_am"
21+
#define AccessMethodOperatorRelationName "pg_amop"
22+
#define AccessMethodProcedureRelationName "pg_amproc"
23+
#define AttributeRelationName "pg_attribute"
24+
#define DatabaseRelationName "pg_database"
25+
#define DefaultsRelationName "pg_defaults"
26+
#define DemonRelationName "pg_demon"
27+
#define GroupRelationName "pg_group"
28+
#define HostsRelationName "pg_hosts"
29+
#define IndexRelationName "pg_index"
30+
#define InheritProcedureRelationName "pg_inheritproc"
31+
#define InheritsRelationName "pg_inherits"
32+
#define InheritancePrecidenceListRelationName "pg_ipl"
33+
#define LanguageRelationName "pg_language"
34+
#define ListenerRelationName "pg_listener"
35+
#define LogRelationName "pg_log"
36+
#define MagicRelationName "pg_magic"
37+
#define OperatorClassRelationName "pg_opclass"
38+
#define OperatorRelationName "pg_operator"
39+
#define ProcedureRelationName "pg_proc"
40+
#define RelationRelationName "pg_class"
41+
#define RewriteRelationName "pg_rewrite"
42+
#define ServerRelationName "pg_server"
43+
#define StatisticRelationName "pg_statistic"
44+
#define TimeRelationName "pg_time"
45+
#define TypeRelationName "pg_type"
46+
#define UserRelationName "pg_user"
47+
#define VariableRelationName "pg_variable"
48+
#define VersionRelationName "pg_version"
49+
50+
extern char *SharedSystemRelationNames[];
51+
52+
#endif /* CATNAME_H */

src/include/catalog/heap.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* heap.h--
4+
* prototypes for functions in lib/catalog/heap.c
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: heap.h,v 1.1 1996/08/28 01:56:26 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef HEAP_H
14+
#define HEAP_H
15+
16+
extern Relation heap_creatr(char *relname, unsigned smgr, TupleDesc att);
17+
18+
extern int RelationAlreadyExists(Relation pg_class_desc, char relname[]);
19+
extern void addNewRelationType(char *typeName, Oid new_rel_oid);
20+
21+
extern void AddPgRelationTuple(Relation pg_class_desc,
22+
Relation new_rel_desc, Oid new_rel_oid, int arch, unsigned natts);
23+
24+
extern Oid heap_create(char relname[],
25+
char *typename,
26+
int arch,
27+
unsigned smgr, TupleDesc tupdesc);
28+
29+
extern void RelationRemoveInheritance(Relation relation);
30+
extern void RelationRemoveIndexes(Relation relation);
31+
extern void DeletePgRelationTuple(Relation rdesc);
32+
extern void DeletePgAttributeTuples(Relation rdesc);
33+
extern void DeletePgTypeTuple(Relation rdesc);
34+
extern void heap_destroy(char relname[]);
35+
extern void heap_destroyr(Relation r);
36+
37+
extern void InitTempRelList();
38+
extern void AddToTempRelList(Relation r);
39+
extern void RemoveFromTempRelList(Relation r);
40+
extern void DestroyTempRels();
41+
42+
#endif /* HEAP_H */

src/include/catalog/index.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* index.h--
4+
* prototypes for index.c.
5+
*
6+
*
7+
* Copyright (c) 1994, Regents of the University of California
8+
*
9+
* $Id: index.h,v 1.1 1996/08/28 01:56:27 scrappy Exp $
10+
*
11+
*-------------------------------------------------------------------------
12+
*/
13+
#ifndef INDEX_H
14+
#define INDEX_H
15+
16+
#include "access/funcindex.h"
17+
#include "access/itup.h"
18+
#include "nodes/execnodes.h"
19+
#include "nodes/parsenodes.h"
20+
21+
22+
extern Form_pg_am
23+
AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId);
24+
25+
extern void
26+
UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate);
27+
28+
extern void InitIndexStrategy(int numatts,
29+
Relation indexRelation,
30+
Oid accessMethodObjectId);
31+
32+
extern void index_create(char *heapRelationName,
33+
char* indexRelationName,
34+
FuncIndexInfo *funcInfo,
35+
TypeName *IndexKeyType,
36+
Oid accessMethodObjectId,
37+
int numatts,
38+
AttrNumber attNums[],
39+
Oid classObjectId[],
40+
uint16 parameterCount,
41+
Datum *parameter,
42+
Node *predicate,
43+
bool islossy);
44+
45+
extern void index_destroy(Oid indexId);
46+
47+
extern void FormIndexDatum(int numberOfAttributes,
48+
AttrNumber attributeNumber[], HeapTuple heapTuple,
49+
TupleDesc heapDescriptor, Buffer buffer, Datum *datum,
50+
char *nullv, FuncIndexInfoPtr fInfo);
51+
52+
extern void UpdateStats(Oid relid, long reltuples, bool hasindex);
53+
54+
extern void FillDummyExprContext(ExprContext *econtext, TupleTableSlot *slot,
55+
TupleDesc tupdesc, Buffer buffer);
56+
57+
extern void index_build(Relation heapRelation, Relation indexRelation,
58+
int numberOfAttributes, AttrNumber attributeNumber[],
59+
uint16 parameterCount, Datum *parameter, FuncIndexInfo *funcInfo,
60+
PredInfo *predInfo);
61+
62+
#endif /* INDEX_H */

src/include/catalog/indexing.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*-------------------------------------------------------------------------
2+
*
3+
* indexing.h--
4+
* This include provides some definitions to support indexing
5+
* on system catalogs
6+
*
7+
*
8+
* Copyright (c) 1994, Regents of the University of California
9+
*
10+
* $Id: indexing.h,v 1.1 1996/08/28 01:56:29 scrappy Exp $
11+
*
12+
*-------------------------------------------------------------------------
13+
*/
14+
#ifndef INDEXING_H
15+
#define INDEXING_H
16+
17+
#include "utils/rel.h"
18+
19+
/*
20+
* Some definitions for indices on pg_attribute
21+
*/
22+
#define Num_pg_attr_indices 3
23+
#define Num_pg_proc_indices 3
24+
#define Num_pg_type_indices 2
25+
#define Num_pg_class_indices 2
26+
27+
28+
/*
29+
* Names of indices on system catalogs
30+
*/
31+
#define AttributeNameIndex "pg_attnameind"
32+
#define AttributeNumIndex "pg_attnumind"
33+
#define AttributeRelidIndex "pg_attrelidind"
34+
#define ProcedureNameIndex "pg_procnameind"
35+
#define ProcedureOidIndex "pg_procidind"
36+
#define ProcedureSrcIndex "pg_procsrcind"
37+
#define TypeNameIndex "pg_typenameind"
38+
#define TypeOidIndex "pg_typeidind"
39+
#define ClassNameIndex "pg_classnameind"
40+
#define ClassOidIndex "pg_classoidind"
41+
42+
extern char *Name_pg_attr_indices[];
43+
extern char *Name_pg_proc_indices[];
44+
extern char *Name_pg_type_indices[];
45+
extern char *Name_pg_class_indices[];
46+
47+
extern char *IndexedCatalogNames[];
48+
49+
/*
50+
* indexing.c prototypes
51+
*
52+
* Functions for each index to perform the necessary scan on a cache miss.
53+
*/
54+
extern void CatalogOpenIndices(int nIndices, char *names[], Relation idescs[]);
55+
extern void CatalogCloseIndices(int nIndices, Relation *idescs);
56+
extern void CatalogIndexInsert(Relation *idescs,
57+
int nIndices,
58+
Relation heapRelation,
59+
HeapTuple heapTuple);
60+
extern bool CatalogHasIndex(char *catName, Oid catId);
61+
62+
extern HeapTuple AttributeNameIndexScan(Relation heapRelation,
63+
Oid relid,
64+
char *attname);
65+
66+
extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
67+
Oid relid,
68+
AttrNumber attnum);
69+
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
70+
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
71+
char *procName, int nargs, Oid *argTypes);
72+
extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
73+
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
74+
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
75+
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
76+
extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
77+
78+
79+
/*
80+
* What follows are lines processed by genbki.sh to create the statements
81+
* the bootstrap parser will turn into DefineIndex commands.
82+
*
83+
* The keyword is DECLARE_INDEX every thing after that is just like in a
84+
* normal specification of the 'define index' POSTQUEL command.
85+
*/
86+
DECLARE_INDEX(pg_attnameind on pg_attribute using btree (mkoidname(attrelid, attname) oidname_ops));
87+
DECLARE_INDEX(pg_attnumind on pg_attribute using btree (mkoidint2(attrelid, attnum) oidint2_ops));
88+
DECLARE_INDEX(pg_attrelidind on pg_attribute using btree (attrelid oid_ops));
89+
90+
DECLARE_INDEX(pg_procidind on pg_proc using btree (Oid oid_ops));
91+
DECLARE_INDEX(pg_procnameind on pg_proc using btree (proname name_ops));
92+
DECLARE_INDEX(pg_procsrcind on pg_proc using btree (prosrc text_ops));
93+
94+
DECLARE_INDEX(pg_typeidind on pg_type using btree (Oid oid_ops));
95+
DECLARE_INDEX(pg_typenameind on pg_type using btree (typname name_ops));
96+
97+
DECLARE_INDEX(pg_classnameind on pg_class using btree (relname name_ops));
98+
DECLARE_INDEX(pg_classoidind on pg_class using btree (Oid oid_ops));
99+
100+
/* now build indices in the initialization scripts */
101+
BUILD_INDICES
102+
103+
#endif /* INDEXING_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy