Commit 4136e1d0 authored by Tom Lane's avatar Tom Lane

Convert the list of syscache names from a series of #define's into an enum,

to avoid the pain of manually renumbering them anytime we insert another
name in alphabetical order.  An excellent idea from Alex Hunsaker and
NikhilS' inherited-constraints patch --- whether or not the rest of that
gets in, this should.  Dunno why we never thought of it before.
parent 4222d7f0
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.71 2008/01/01 19:45:59 momjian Exp $ * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.72 2008/05/07 01:04:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -19,63 +19,65 @@ ...@@ -19,63 +19,65 @@
#include "utils/catcache.h" #include "utils/catcache.h"
/* /*
* Declarations for util/syscache.c.
*
* SysCache identifiers. * SysCache identifiers.
* *
* The order of these must match the order * The order of these identifiers must match the order
* they are entered into the structure cacheinfo[] in syscache.c. * of the entries in the array cacheinfo[] in syscache.c.
* Keep them in alphabetical order. * Keep them in alphabetical order (renumbering only costs a
* backend rebuild).
*/ */
#define AGGFNOID 0 enum SysCacheIdentifier
#define AMNAME 1 {
#define AMOID 2 AGGFNOID = 0,
#define AMOPOPID 3 AMNAME,
#define AMOPSTRATEGY 4 AMOID,
#define AMPROCNUM 5 AMOPOPID,
#define ATTNAME 6 AMOPSTRATEGY,
#define ATTNUM 7 AMPROCNUM,
#define AUTHMEMMEMROLE 8 ATTNAME,
#define AUTHMEMROLEMEM 9 ATTNUM,
#define AUTHNAME 10 AUTHMEMMEMROLE,
#define AUTHOID 11 AUTHMEMROLEMEM,
#define CASTSOURCETARGET 12 AUTHNAME,
#define CLAAMNAMENSP 13 AUTHOID,
#define CLAOID 14 CASTSOURCETARGET,
#define CONDEFAULT 15 CLAAMNAMENSP,
#define CONNAMENSP 16 CLAOID,
#define CONSTROID 17 CONDEFAULT,
#define CONVOID 18 CONNAMENSP,
#define DATABASEOID 19 CONSTROID,
#define ENUMOID 20 CONVOID,
#define ENUMTYPOIDNAME 21 DATABASEOID,
#define INDEXRELID 22 ENUMOID,
#define LANGNAME 23 ENUMTYPOIDNAME,
#define LANGOID 24 INDEXRELID,
#define NAMESPACENAME 25 LANGNAME,
#define NAMESPACEOID 26 LANGOID,
#define OPERNAMENSP 27 NAMESPACENAME,
#define OPEROID 28 NAMESPACEOID,
#define OPFAMILYAMNAMENSP 29 OPERNAMENSP,
#define OPFAMILYOID 30 OPEROID,
#define PROCNAMEARGSNSP 31 OPFAMILYAMNAMENSP,
#define PROCOID 32 OPFAMILYOID,
#define RELNAMENSP 33 PROCNAMEARGSNSP,
#define RELOID 34 PROCOID,
#define RULERELNAME 35 RELNAMENSP,
#define STATRELATT 36 RELOID,
#define TSCONFIGMAP 37 RULERELNAME,
#define TSCONFIGNAMENSP 38 STATRELATT,
#define TSCONFIGOID 39 TSCONFIGMAP,
#define TSDICTNAMENSP 40 TSCONFIGNAMENSP,
#define TSDICTOID 41 TSCONFIGOID,
#define TSPARSERNAMENSP 42 TSDICTNAMENSP,
#define TSPARSEROID 43 TSDICTOID,
#define TSTEMPLATENAMENSP 44 TSPARSERNAMENSP,
#define TSTEMPLATEOID 45 TSPARSEROID,
#define TYPENAMENSP 46 TSTEMPLATENAMENSP,
#define TYPEOID 47 TSTEMPLATEOID,
TYPENAMENSP,
TYPEOID
};
extern void InitCatalogCache(void); extern void InitCatalogCache(void);
extern void InitCatalogCachePhase2(void); extern void InitCatalogCachePhase2(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment