Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 09baa3c

Browse files
committed
This patch...
1. Removes the unnecessary "#define AbcRegProcedure 123"'s from pg_proc.h. 2. Changes those #defines to use the names already defined in fmgr.h. 3. Forces the make of fmgr.h in backend/Makefile instead of having it made as a dependency in access/common/Makefile *hack*hack*hack* 4. Rearranged the #includes to a less helter-skelter arrangement, also changing <file.h> to "file.h" to signify a non-system header. 5. Removed "pg_proc.h" from files where its only purpose was for the #defines removed in item #1. 6. Added "fmgr.h" to each file changed for completeness sake. Turns out that postgres#6 was not necessary for some files because fmgr.h was being included in a roundabout way SIX levels deep by the first include. "access/genam.h" ->"access/relscan.h" ->"utils/rel.h" ->"access/strat.h" ->"access/skey.h" ->"fmgr.h" So adding fmgr.h really didn't add anything to the compile, hopefully just made it clearer to the programmer. S Darren.
1 parent e8fd57d commit 09baa3c

File tree

29 files changed

+470
-522
lines changed

29 files changed

+470
-522
lines changed

src/backend/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#
3535
#
3636
# IDENTIFICATION
37-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.32 1998/04/06 16:49:14 momjian Exp $
37+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.33 1998/04/27 04:04:05 momjian Exp $
3838
#
3939
#-------------------------------------------------------------------------
4040

@@ -62,7 +62,7 @@ endif
6262
all: postgres $(POSTGRES_IMP) global1.bki.source local1_template1.bki.source \
6363
global1.description local1_template1.description
6464

65-
postgres: $(OBJS) ../utils/version.o
65+
postgres: fmgr.h $(OBJS) ../utils/version.o
6666
$(CC) -o postgres $(OBJS) ../utils/version.o $(LDFLAGS)
6767

6868
$(OBJS): $(DIRS:%=%.dir)

src/backend/access/index/istrat.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.18 1998/04/06 17:27:06 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.19 1998/04/27 04:04:09 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include <postgres.h>
16+
#include "postgres.h"
1717

18-
#include <catalog/pg_proc.h>
19-
#include <catalog/pg_operator.h>
20-
#include <catalog/catname.h>
21-
#include <catalog/pg_index.h>
22-
#include <catalog/pg_amop.h>
23-
#include <catalog/pg_amproc.h>
24-
#include <utils/memutils.h> /* could have been access/itup.h */
25-
#include <access/heapam.h>
26-
#include <access/istrat.h>
27-
#include <fmgr.h>
18+
#include "access/heapam.h"
19+
#include "access/istrat.h"
20+
#include "catalog/catname.h"
21+
#include "catalog/pg_amop.h"
22+
#include "catalog/pg_amproc.h"
23+
#include "catalog/pg_index.h"
24+
#include "catalog/pg_operator.h"
25+
#include "fmgr.h"
26+
#include "utils/memutils.h" /* could have been access/itup.h */
2827

2928
#ifdef USE_ASSERT_CHECKING
3029
static bool StrategyEvaluationIsValid(StrategyEvaluation evaluation);
@@ -505,7 +504,7 @@ OperatorRelationFillScanKeyEntry(Relation operatorRelation,
505504

506505
ScanKeyEntryInitialize(&scanKeyData, 0,
507506
ObjectIdAttributeNumber,
508-
ObjectIdEqualRegProcedure,
507+
F_OIDEQ,
509508
ObjectIdGetDatum(operatorObjectId));
510509

511510
scan = heap_beginscan(operatorRelation, false, false,
@@ -561,7 +560,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
561560
maxStrategyNumber = AMStrategies(maxStrategyNumber);
562561

563562
ScanKeyEntryInitialize(&entry[0], 0, Anum_pg_index_indexrelid,
564-
ObjectIdEqualRegProcedure,
563+
F_OIDEQ,
565564
ObjectIdGetDatum(indexObjectId));
566565

567566
relation = heap_openr(IndexRelationName);
@@ -601,11 +600,11 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
601600
{
602601

603602
ScanKeyEntryInitialize(&entry[0], 0, Anum_pg_amproc_amid,
604-
ObjectIdEqualRegProcedure,
603+
F_OIDEQ,
605604
ObjectIdGetDatum(accessMethodObjectId));
606605

607606
ScanKeyEntryInitialize(&entry[1], 0, Anum_pg_amproc_amopclaid,
608-
ObjectIdEqualRegProcedure, 0);
607+
F_OIDEQ, 0);
609608

610609
/* relation = heap_openr(Name_pg_amproc); */
611610
relation = heap_openr(AccessMethodProcedureRelationName);
@@ -646,12 +645,12 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
646645

647646
ScanKeyEntryInitialize(&entry[0], 0,
648647
Anum_pg_amop_amopid,
649-
ObjectIdEqualRegProcedure,
648+
F_OIDEQ,
650649
ObjectIdGetDatum(accessMethodObjectId));
651650

652651
ScanKeyEntryInitialize(&entry[1], 0,
653652
Anum_pg_amop_amopclaid,
654-
ObjectIdEqualRegProcedure, 0);
653+
F_OIDEQ, 0);
655654

656655
relation = heap_openr(AccessMethodOperatorRelationName);
657656
operatorRelation = heap_openr(OperatorRelationName);

src/backend/access/nbtree/nbtutils.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.18 1998/01/15 19:42:15 pgsql Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.19 1998/04/27 04:04:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

15-
#include <postgres.h>
15+
#include "postgres.h"
1616

17-
#include <access/genam.h>
18-
#include <fmgr.h>
19-
#include <storage/bufpage.h>
20-
#include <access/nbtree.h>
21-
#include <access/istrat.h>
22-
#include <access/iqual.h>
23-
#include <catalog/pg_proc.h>
24-
#include <executor/execdebug.h>
17+
#include "access/genam.h"
18+
#include "access/iqual.h"
19+
#include "access/istrat.h"
20+
#include "access/nbtree.h"
21+
#include "executor/execdebug.h"
22+
#include "fmgr.h"
23+
#include "storage/bufpage.h"
2524

2625
extern int NIndexTupleProcessed;
2726

@@ -54,7 +53,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
5453
arg = index_getattr(itup, i + 1, itupdesc, &null);
5554
if (null)
5655
{
57-
proc = NullValueRegProcedure;
56+
proc = F_NULLVALUE;
5857
flag = SK_ISNULL;
5958
}
6059
else

src/backend/catalog/aclchk.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.8 1998/02/26 04:30:26 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.9 1998/04/27 04:04:36 momjian Exp $
1111
*
1212
* NOTES
1313
* See acl.h.
@@ -21,23 +21,22 @@
2121
#include "access/heapam.h"
2222
#include "access/htup.h"
2323
#include "access/tupmacs.h"
24-
#include "utils/builtins.h"
25-
#include "utils/memutils.h"
26-
#include "utils/palloc.h"
2724
#include "catalog/indexing.h"
2825
#include "catalog/catalog.h"
2926
#include "catalog/catname.h"
27+
#include "catalog/pg_aggregate.h"
3028
#include "catalog/pg_group.h"
3129
#include "catalog/pg_operator.h"
32-
#include "catalog/pg_aggregate.h"
3330
#include "catalog/pg_proc.h"
34-
#include "catalog/pg_type.h"
3531
#include "catalog/pg_shadow.h"
32+
#include "catalog/pg_type.h"
33+
#include "fmgr.h"
3634
#include "parser/parse_agg.h"
3735
#include "parser/parse_func.h"
36+
#include "utils/builtins.h"
37+
#include "utils/memutils.h"
3838
#include "utils/syscache.h"
3939
#include "utils/tqual.h"
40-
#include "fmgr.h"
4140

4241
static int32 aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode);
4342

@@ -99,7 +98,7 @@ ChangeAcl(char *relname,
9998
*new_acl;
10099
Relation relation;
101100
static ScanKeyData relkey[1] = {
102-
{0, Anum_pg_class_relname, NameEqualRegProcedure}
101+
{0, Anum_pg_class_relname, F_NAMEEQ}
103102
};
104103
HeapScanDesc hsdp;
105104
HeapTuple htp;
@@ -122,7 +121,7 @@ ChangeAcl(char *relname,
122121
if (!RelationIsValid(relation))
123122
elog(ERROR, "ChangeAcl: could not open '%s'??",
124123
RelationRelationName);
125-
fmgr_info(NameEqualRegProcedure, &relkey[0].sk_func);
124+
fmgr_info(F_NAMEEQ, &relkey[0].sk_func);
126125
relkey[0].sk_nargs = relkey[0].sk_func.fn_nargs;
127126
relkey[0].sk_argument = NameGetDatum(relname);
128127
hsdp = heap_beginscan(relation,
@@ -480,7 +479,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
480479
#else
481480
{ /* This is why the syscache is great... */
482481
static ScanKeyData relkey[1] = {
483-
{0, Anum_pg_class_relname, NameEqualRegProcedure}
482+
{0, Anum_pg_class_relname, F_NAMEEQ}
484483
};
485484
HeapScanDesc hsdp;
486485

@@ -491,7 +490,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
491490
RelationRelationName);
492491
return ACLCHECK_NO_CLASS;
493492
}
494-
fmgr_info(NameEqualRegProcedure,
493+
fmgr_info(F_NAMEEQ,
495494
&relkey[0].sk_func,
496495
&relkey[0].sk_nargs);
497496
relkey[0].sk_argument = NameGetDatum(relname);

src/backend/catalog/heap.c

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.47 1998/02/26 04:30:35 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.48 1998/04/27 04:04:47 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
* heap_create() - Create an uncataloged heap relation
@@ -25,38 +25,38 @@
2525
*
2626
*-------------------------------------------------------------------------
2727
*/
28-
#include <postgres.h>
29-
30-
#include <miscadmin.h>
31-
#include <fmgr.h>
32-
#include <access/heapam.h>
33-
#include <catalog/catalog.h>
34-
#include <catalog/catname.h>
35-
#include <catalog/heap.h>
36-
#include <catalog/index.h>
37-
#include <catalog/indexing.h>
38-
#include <catalog/pg_attrdef.h>
39-
#include <catalog/pg_index.h>
40-
#include <catalog/pg_inherits.h>
41-
#include <catalog/pg_ipl.h>
42-
#include <catalog/pg_proc.h>
43-
#include <catalog/pg_relcheck.h>
44-
#include <catalog/pg_type.h>
45-
#include <commands/trigger.h>
46-
#include <nodes/plannodes.h>
47-
#include <optimizer/tlist.h>
48-
#include <parser/parse_expr.h>
49-
#include <parser/parse_node.h>
50-
#include <parser/parse_type.h>
51-
#include <rewrite/rewriteRemove.h>
52-
#include <storage/bufmgr.h>
53-
#include <storage/lmgr.h>
54-
#include <storage/smgr.h>
55-
#include <tcop/tcopprot.h>
56-
#include <utils/builtins.h>
57-
#include <utils/mcxt.h>
58-
#include <utils/relcache.h>
59-
#include <utils/tqual.h>
28+
#include "postgres.h"
29+
30+
#include "access/heapam.h"
31+
#include "catalog/catalog.h"
32+
#include "catalog/catname.h"
33+
#include "catalog/heap.h"
34+
#include "catalog/index.h"
35+
#include "catalog/indexing.h"
36+
#include "catalog/pg_attrdef.h"
37+
#include "catalog/pg_index.h"
38+
#include "catalog/pg_inherits.h"
39+
#include "catalog/pg_ipl.h"
40+
#include "catalog/pg_relcheck.h"
41+
#include "catalog/pg_type.h"
42+
#include "commands/trigger.h"
43+
#include "fmgr.h"
44+
#include "miscadmin.h"
45+
#include "nodes/plannodes.h"
46+
#include "optimizer/tlist.h"
47+
#include "parser/parse_expr.h"
48+
#include "parser/parse_node.h"
49+
#include "parser/parse_type.h"
50+
#include "rewrite/rewriteRemove.h"
51+
#include "storage/bufmgr.h"
52+
#include "storage/lmgr.h"
53+
#include "storage/smgr.h"
54+
#include "tcop/tcopprot.h"
55+
#include "utils/builtins.h"
56+
#include "utils/mcxt.h"
57+
#include "utils/relcache.h"
58+
#include "utils/tqual.h"
59+
6060
#ifndef HAVE_MEMMOVE
6161
#include <regex/utils.h>
6262
#else
@@ -494,7 +494,7 @@ RelationAlreadyExists(Relation pg_class_desc, char relname[])
494494
ScanKeyEntryInitialize(&key,
495495
0,
496496
(AttrNumber) Anum_pg_class_relname,
497-
(RegProcedure) NameEqualRegProcedure,
497+
(RegProcedure) F_NAMEEQ,
498498
(Datum) relname);
499499

500500
/* ----------------
@@ -892,7 +892,7 @@ RelationRemoveInheritance(Relation relation)
892892
* ----------------
893893
*/
894894
ScanKeyEntryInitialize(&entry, 0x0, Anum_pg_inherits_inhparent,
895-
ObjectIdEqualRegProcedure,
895+
F_OIDEQ,
896896
ObjectIdGetDatum(RelationGetRelationId(relation)));
897897

898898
scan = heap_beginscan(catalogRelation,
@@ -987,7 +987,7 @@ RelationRemoveIndexes(Relation relation)
987987
indexRelation = heap_openr(IndexRelationName);
988988

989989
ScanKeyEntryInitialize(&entry, 0x0, Anum_pg_index_indrelid,
990-
ObjectIdEqualRegProcedure,
990+
F_OIDEQ,
991991
ObjectIdGetDatum(RelationGetRelationId(relation)));
992992

993993
scan = heap_beginscan(indexRelation,
@@ -1654,7 +1654,7 @@ RemoveAttrDefault(Relation rel)
16541654
adrel = heap_openr(AttrDefaultRelationName);
16551655

16561656
ScanKeyEntryInitialize(&key, 0, Anum_pg_attrdef_adrelid,
1657-
ObjectIdEqualRegProcedure, rel->rd_id);
1657+
F_OIDEQ, rel->rd_id);
16581658

16591659
RelationSetLockForWrite(adrel);
16601660

@@ -1681,7 +1681,7 @@ RemoveRelCheck(Relation rel)
16811681
rcrel = heap_openr(RelCheckRelationName);
16821682

16831683
ScanKeyEntryInitialize(&key, 0, Anum_pg_relcheck_rcrelid,
1684-
ObjectIdEqualRegProcedure, rel->rd_id);
1684+
F_OIDEQ, rel->rd_id);
16851685

16861686
RelationSetLockForWrite(rcrel);
16871687

0 commit comments

Comments
 (0)