1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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 #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.
This commit is contained in:
Bruce Momjian
1998-04-27 04:08:07 +00:00
parent e8fd57d763
commit 09baa3cc81
29 changed files with 472 additions and 524 deletions

View File

@ -8,19 +8,20 @@
#include <string.h>
#include "postgres.h"
#include "nodes/parsenodes.h"
#include "nodes/memnodes.h"
#include "commands/trigger.h"
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_language.h"
#include "catalog/pg_trigger.h"
#include "access/genam.h"
#include "access/heapam.h"
#include "access/valid.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
#include "catalog/pg_language.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_trigger.h"
#include "commands/trigger.h"
#include "fmgr.h"
#include "nodes/memnodes.h"
#include "nodes/parsenodes.h"
#include "storage/lmgr.h"
#include "storage/bufmgr.h"
#include "utils/mcxt.h"
@ -117,7 +118,7 @@ CreateTrigger(CreateTrigStmt *stmt)
tgrel = heap_openr(TriggerRelationName);
RelationSetLockForWrite(tgrel);
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
ObjectIdEqualRegProcedure, rel->rd_id);
F_OIDEQ, rel->rd_id);
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
while (tuple = heap_getnext(tgscan, 0, (Buffer *) NULL), PointerIsValid(tuple))
{
@ -277,7 +278,7 @@ DropTrigger(DropTrigStmt *stmt)
tgrel = heap_openr(TriggerRelationName);
RelationSetLockForWrite(tgrel);
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
ObjectIdEqualRegProcedure, rel->rd_id);
F_OIDEQ, rel->rd_id);
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
while (tuple = heap_getnext(tgscan, 0, (Buffer *) NULL), PointerIsValid(tuple))
{
@ -341,7 +342,7 @@ RelationRemoveTriggers(Relation rel)
tgrel = heap_openr(TriggerRelationName);
RelationSetLockForWrite(tgrel);
ScanKeyEntryInitialize(&key, 0, Anum_pg_trigger_tgrelid,
ObjectIdEqualRegProcedure, rel->rd_id);
F_OIDEQ, rel->rd_id);
tgscan = heap_beginscan(tgrel, 0, false, 1, &key);
@ -379,7 +380,7 @@ RelationBuildTriggers(Relation relation)
ScanKeyEntryInitialize(&skey,
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) ObjectIdEqualRegProcedure,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relation->rd_id));
tgrel = heap_openr(TriggerRelationName);