diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/async.c | 47 | ||||
-rw-r--r-- | src/backend/commands/command.c | 44 | ||||
-rw-r--r-- | src/backend/commands/dbcommands.c | 20 | ||||
-rw-r--r-- | src/backend/commands/proclang.c | 9 | ||||
-rw-r--r-- | src/backend/commands/remove.c | 57 | ||||
-rw-r--r-- | src/backend/commands/trigger.c | 25 | ||||
-rw-r--r-- | src/backend/commands/vacuum.c | 73 |
7 files changed, 138 insertions, 137 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index b8cf416492d..551c3bad3fd 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.30 1998/04/01 03:13:37 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.31 1998/04/27 04:05:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -65,25 +65,24 @@ #include <sys/types.h> /* Needed by in.h on Ultrix */ #include <netinet/in.h> -#include <postgres.h> - -#include <miscadmin.h> -#include <utils/syscache.h> -#include <access/relscan.h> -#include <access/xact.h> -#include <lib/dllist.h> -#include <tcop/dest.h> -#include <catalog/pg_proc.h> -#include <catalog/catname.h> -#include <catalog/pg_listener.h> -#include <access/heapam.h> -#include <storage/bufmgr.h> -#include <nodes/memnodes.h> -#include <utils/mcxt.h> -#include <commands/async.h> -#include <libpq/libpq.h> - -#include <storage/lmgr.h> +#include "postgres.h" + +#include "access/heapam.h" +#include "access/relscan.h" +#include "access/xact.h" +#include "catalog/catname.h" +#include "catalog/pg_listener.h" +#include "commands/async.h" +#include "fmgr.h" +#include "lib/dllist.h" +#include "libpq/libpq.h" +#include "miscadmin.h" +#include "nodes/memnodes.h" +#include "storage/bufmgr.h" +#include "storage/lmgr.h" +#include "tcop/dest.h" +#include "utils/mcxt.h" +#include "utils/syscache.h" static int notifyFrontEndPending = 0; static int notifyIssued = 0; @@ -199,7 +198,7 @@ Async_Notify(char *relname) ScanKeyEntryInitialize(&key, 0, Anum_pg_listener_relname, - NameEqualRegProcedure, + F_NAMEEQ, PointerGetDatum(notifyName)); lRel = heap_openr(ListenerRelationName); @@ -281,7 +280,7 @@ Async_NotifyAtCommit() #endif ScanKeyEntryInitialize(&key, 0, Anum_pg_listener_notify, - Integer32EqualRegProcedure, + F_INT4EQ, Int32GetDatum(1)); lRel = heap_openr(ListenerRelationName); RelationSetLockForWrite(lRel); @@ -584,11 +583,11 @@ Async_NotifyFrontEnd() StartTransactionCommand(); ScanKeyEntryInitialize(&key[0], 0, Anum_pg_listener_notify, - Integer32EqualRegProcedure, + F_INT4EQ, Int32GetDatum(1)); ScanKeyEntryInitialize(&key[1], 0, Anum_pg_listener_pid, - Integer32EqualRegProcedure, + F_INT4EQ, Int32GetDatum(MyProcPid)); lRel = heap_openr(ListenerRelationName); RelationSetLockForWrite(lRel); diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c index 0bf94de2200..f41b612369c 100644 --- a/src/backend/commands/command.c +++ b/src/backend/commands/command.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.26 1998/02/26 04:30:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.27 1998/04/27 04:05:10 momjian Exp $ * * NOTES * The PortalExecutorHeapMemory crap needs to be eliminated @@ -20,25 +20,25 @@ * *------------------------------------------------------------------------- */ -#include <postgres.h> - -#include <access/relscan.h> -#include <utils/portal.h> -#include <commands/command.h> -#include <utils/mcxt.h> -#include <executor/executor.h> -#include <executor/execdefs.h> -#include <catalog/indexing.h> -#include <utils/syscache.h> -#include <catalog/catalog.h> -#include <access/heapam.h> -#include <utils/array.h> -#include <utils/acl.h> -#include <optimizer/prep.h> -#include <catalog/catname.h> -#include <catalog/pg_proc.h> -#include <catalog/pg_type.h> -#include <utils/builtins.h> +#include "postgres.h" + +#include "access/heapam.h" +#include "access/relscan.h" +#include "catalog/indexing.h" +#include "catalog/catalog.h" +#include "catalog/catname.h" +#include "catalog/pg_type.h" +#include "commands/command.h" +#include "executor/execdefs.h" +#include "executor/executor.h" +#include "fmgr.h" +#include "optimizer/prep.h" +#include "utils/acl.h" +#include "utils/array.h" +#include "utils/builtins.h" +#include "utils/mcxt.h" +#include "utils/portal.h" +#include "utils/syscache.h" /* ---------------- * PortalExecutorHeapMemory stuff @@ -409,13 +409,13 @@ PerformAddAttribute(char *relationName, ScanKeyEntryInitialize(&key[0], (bits16) NULL, (AttrNumber) Anum_pg_attribute_attrelid, - (RegProcedure) ObjectIdEqualRegProcedure, + (RegProcedure) F_OIDEQ, (Datum) reltup->t_oid); ScanKeyEntryInitialize(&key[1], (bits16) NULL, (AttrNumber) Anum_pg_attribute_attname, - (RegProcedure) NameEqualRegProcedure, + (RegProcedure) F_NAMEEQ, (Datum) NULL); attributeD.attrelid = reltup->t_oid; diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 3df6bc36ee3..44b19650e08 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.12 1998/04/26 04:06:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.13 1998/04/27 04:05:11 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -17,22 +17,22 @@ #include <sys/stat.h> #include "postgres.h" -#include "miscadmin.h" /* for DataDir */ + #include "access/heapam.h" #include "access/htup.h" #include "access/relscan.h" -#include "utils/rel.h" -#include "utils/elog.h" #include "catalog/catname.h" -#include "catalog/pg_proc.h" -#include "catalog/pg_shadow.h" #include "catalog/pg_database.h" -#include "utils/syscache.h" +#include "catalog/pg_shadow.h" #include "commands/dbcommands.h" -#include "tcop/tcopprot.h" +#include "fmgr.h" +#include "miscadmin.h" /* for DataDir */ #include "storage/bufmgr.h" -#include "storage/lmgr.h" #include "storage/fd.h" +#include "storage/lmgr.h" +#include "tcop/tcopprot.h" +#include "utils/rel.h" +#include "utils/syscache.h" /* non-export function prototypes */ @@ -157,7 +157,7 @@ get_pg_dbtup(char *command, char *dbname, Relation dbrel) ScanKeyData scanKey; ScanKeyEntryInitialize(&scanKey, 0, Anum_pg_database_datname, - NameEqualRegProcedure, NameGetDatum(dbname)); + F_NAMEEQ, NameGetDatum(dbname)); scan = heap_beginscan(dbrel, 0, false, 1, &scanKey); if (!HeapScanIsValid(scan)) diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index aac12979509..2a218b68637 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -7,16 +7,17 @@ */ #include <ctype.h> #include <string.h> + #include "postgres.h" #include "access/heapam.h" #include "catalog/catname.h" -#include "catalog/pg_shadow.h" -#include "catalog/pg_proc.h" #include "catalog/pg_language.h" -#include "utils/syscache.h" +#include "catalog/pg_proc.h" +#include "catalog/pg_shadow.h" #include "commands/proclang.h" #include "fmgr.h" +#include "utils/syscache.h" static void @@ -120,7 +121,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) values[i++] = Int8GetDatum((bool) 1); values[i++] = Int8GetDatum(stmt->pltrusted); values[i++] = ObjectIdGetDatum(procTup->t_oid); - values[i++] = (Datum) fmgr(TextInRegProcedure, stmt->plcompiler); + values[i++] = (Datum) fmgr(F_TEXTIN, stmt->plcompiler); rdesc = heap_openr(LanguageRelationName); diff --git a/src/backend/commands/remove.c b/src/backend/commands/remove.c index d95b41b1487..5a33f1999f2 100644 --- a/src/backend/commands/remove.c +++ b/src/backend/commands/remove.c @@ -7,27 +7,28 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.22 1998/02/11 19:10:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.23 1998/04/27 04:05:19 momjian Exp $ * *------------------------------------------------------------------------- */ -#include <postgres.h> - -#include <utils/acl.h> -#include <access/heapam.h> -#include <utils/builtins.h> -#include <utils/syscache.h> -#include <catalog/catname.h> -#include <commands/defrem.h> -#include <miscadmin.h> -#include <catalog/pg_aggregate.h> -#include <catalog/pg_language.h> -#include <catalog/pg_operator.h> -#include <catalog/pg_proc.h> -#include <catalog/pg_type.h> -#include <parser/parse_func.h> -#include <storage/bufmgr.h> -#include <fmgr.h> +#include "postgres.h" + +#include "access/heapam.h" +#include "catalog/catname.h" +#include "catalog/pg_aggregate.h" +#include "catalog/pg_language.h" +#include "catalog/pg_operator.h" +#include "catalog/pg_proc.h" +#include "catalog/pg_type.h" +#include "commands/defrem.h" +#include "fmgr.h" +#include "miscadmin.h" +#include "parser/parse_func.h" +#include "storage/bufmgr.h" +#include "utils/acl.h" +#include "utils/builtins.h" +#include "utils/syscache.h" + #ifndef HAVE_MEMMOVE #include <regex/utils.h> #else @@ -82,17 +83,17 @@ RemoveOperator(char *operatorName, /* operator name */ ScanKeyEntryInitialize(&operatorKey[0], 0x0, Anum_pg_operator_oprname, - NameEqualRegProcedure, + F_NAMEEQ, PointerGetDatum(operatorName)); ScanKeyEntryInitialize(&operatorKey[1], 0x0, Anum_pg_operator_oprleft, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(typeId1)); ScanKeyEntryInitialize(&operatorKey[2], 0x0, Anum_pg_operator_oprright, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(typeId2)); relation = heap_openr(OperatorRelationName); @@ -159,7 +160,7 @@ SingleOpOperatorRemove(Oid typeOid) int i; ScanKeyEntryInitialize(&key[0], - 0, 0, ObjectIdEqualRegProcedure, (Datum) typeOid); + 0, 0, F_OIDEQ, (Datum) typeOid); rdesc = heap_openr(OperatorRelationName); for (i = 0; i < 3; ++i) { @@ -207,7 +208,7 @@ AttributeAndRelationRemove(Oid typeOid) */ ScanKeyEntryInitialize(&key[0], - 0, 3, ObjectIdEqualRegProcedure, (Datum) typeOid); + 0, 3, F_OIDEQ, (Datum) typeOid); oidptr = (struct oidlist *) palloc(sizeof(*oidptr)); oidptr->next = NULL; @@ -228,7 +229,7 @@ AttributeAndRelationRemove(Oid typeOid) ScanKeyEntryInitialize(&key[0], 0, ObjectIdAttributeNumber, - ObjectIdEqualRegProcedure, (Datum) 0); + F_OIDEQ, (Datum) 0); optr = oidptr; rdesc = heap_openr(RelationRelationName); while (PointerIsValid((char *) optr->next)) @@ -264,7 +265,7 @@ RemoveType(char *typeName) /* type name to be removed */ Oid typeOid; ItemPointerData itemPointerData; static ScanKeyData typeKey[1] = { - {0, Anum_pg_type_typname, NameEqualRegProcedure} + {0, Anum_pg_type_typname, F_NAMEEQ} }; char *shadow_type; char *userName; @@ -342,7 +343,7 @@ RemoveFunction(char *functionName, /* function name to be removed */ Form_pg_proc the_proc = NULL; ItemPointerData itemPointerData; static ScanKeyData key[3] = { - {0, Anum_pg_proc_proname, NameEqualRegProcedure} + {0, Anum_pg_proc_proname, F_NAMEEQ} }; char *userName; char *typename; @@ -489,12 +490,12 @@ RemoveAggregate(char *aggName, char *aggType) ScanKeyEntryInitialize(&aggregateKey[0], 0x0, Anum_pg_aggregate_aggname, - NameEqualRegProcedure, + F_NAMEEQ, PointerGetDatum(aggName)); ScanKeyEntryInitialize(&aggregateKey[1], 0x0, Anum_pg_aggregate_aggbasetype, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(basetypeID)); relation = heap_openr(AggregateRelationName); diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index c0ab43da7cc..45e3225de66 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -8,19 +8,20 @@ #include <string.h> #include "postgres.h" -#include "nodes/parsenodes.h" -#include "nodes/memnodes.h" -#include "commands/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_proc.h" #include "catalog/pg_language.h" +#include "catalog/pg_proc.h" #include "catalog/pg_trigger.h" -#include "access/genam.h" -#include "access/heapam.h" -#include "access/valid.h" -#include "access/xact.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); diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 882f5ca106b..180523f8bf2 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.63 1998/02/26 04:31:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.64 1998/04/27 04:05:31 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -18,35 +18,34 @@ #include <fcntl.h> #include <unistd.h> -#include <postgres.h> - -#include <fmgr.h> -#include <utils/portal.h> -#include <access/genam.h> -#include <access/heapam.h> -#include <access/xact.h> -#include <storage/bufmgr.h> -#include <access/transam.h> -#include <catalog/pg_index.h> -#include <catalog/index.h> -#include <catalog/catname.h> -#include <catalog/catalog.h> -#include <catalog/pg_class.h> -#include <catalog/pg_proc.h> -#include <catalog/pg_statistic.h> -#include <catalog/pg_type.h> -#include <catalog/pg_operator.h> -#include <parser/parse_oper.h> -#include <storage/smgr.h> -#include <storage/lmgr.h> -#include <utils/inval.h> -#include <utils/mcxt.h> -#include <utils/inval.h> -#include <utils/syscache.h> -#include <utils/builtins.h> -#include <commands/vacuum.h> -#include <storage/bufpage.h> +#include "postgres.h" + +#include "access/genam.h" +#include "access/heapam.h" +#include "access/transam.h" +#include "access/xact.h" +#include "catalog/catalog.h" +#include "catalog/catname.h" +#include "catalog/index.h" +#include "catalog/pg_class.h" +#include "catalog/pg_index.h" +#include "catalog/pg_operator.h" +#include "catalog/pg_statistic.h" +#include "catalog/pg_type.h" +#include "commands/vacuum.h" +#include "fmgr.h" +#include "parser/parse_oper.h" +#include "storage/bufmgr.h" +#include "storage/bufpage.h" #include "storage/shmem.h" +#include "storage/smgr.h" +#include "storage/lmgr.h" +#include "utils/builtins.h" +#include "utils/inval.h" +#include "utils/mcxt.h" +#include "utils/portal.h" +#include "utils/syscache.h" + #ifndef HAVE_GETRUSAGE #include <rusagestub.h> #else @@ -279,13 +278,13 @@ vc_getrels(NameData *VacRelP) if (VacRelP->data) { ScanKeyEntryInitialize(&pgckey, 0x0, Anum_pg_class_relname, - NameEqualRegProcedure, + F_NAMEEQ, PointerGetDatum(VacRelP->data)); } else { ScanKeyEntryInitialize(&pgckey, 0x0, Anum_pg_class_relkind, - CharacterEqualRegProcedure, CharGetDatum('r')); + F_CHAREQ, CharGetDatum('r')); } portalmem = PortalGetVariableMemory(vc_portal); @@ -398,7 +397,7 @@ vc_vacone(Oid relid, bool analyze, List *va_cols) StartTransactionCommand(); ScanKeyEntryInitialize(&pgckey, 0x0, ObjectIdAttributeNumber, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(relid)); pgclass = heap_openr(RelationRelationName); @@ -1776,7 +1775,7 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst * update number of tuples and number of pages in pg_class */ ScanKeyEntryInitialize(&rskey, 0x0, ObjectIdAttributeNumber, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(relid)); rd = heap_openr(RelationRelationName); @@ -1890,10 +1889,10 @@ vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelst values[i++] = (Datum) InvalidOid; /* 3 */ fmgr_info(stats->outfunc, &out_function); out_string = (*fmgr_faddr(&out_function)) (stats->min, stats->attr->atttypid); - values[i++] = (Datum) fmgr(TextInRegProcedure, out_string); + values[i++] = (Datum) fmgr(F_TEXTIN, out_string); pfree(out_string); out_string = (char *) (*fmgr_faddr(&out_function)) (stats->max, stats->attr->atttypid); - values[i++] = (Datum) fmgr(TextInRegProcedure, out_string); + values[i++] = (Datum) fmgr(F_TEXTIN, out_string); pfree(out_string); sdesc = sd->rd_att; @@ -1948,7 +1947,7 @@ vc_delhilowstats(Oid relid, int attcnt, int *attnums) if (relid != InvalidOid) { ScanKeyEntryInitialize(&pgskey, 0x0, Anum_pg_statistic_starelid, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(relid)); pgsscan = heap_beginscan(pgstatistic, false, false, 1, &pgskey); } @@ -2159,7 +2158,7 @@ vc_getindices(Oid relid, int *nindices, Relation **Irel) pgidesc = RelationGetTupleDescriptor(pgindex); ScanKeyEntryInitialize(&pgikey, 0x0, Anum_pg_index_indrelid, - ObjectIdEqualRegProcedure, + F_OIDEQ, ObjectIdGetDatum(relid)); pgiscan = heap_beginscan(pgindex, false, false, 1, &pgikey); |