Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4136e1d

Browse files
committed
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 anothername in alphabetical order. An excellent idea from Alex Hunsaker andNikhilS' inherited-constraints patch --- whether or not the rest of thatgets in, this should. Dunno why we never thought of it before.
1 parent4222d7f commit4136e1d

File tree

1 file changed

+56
-54
lines changed

1 file changed

+56
-54
lines changed

‎src/include/utils/syscache.h

Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.71 2008/01/01 19:45:59 momjian Exp $
12+
* $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.72 2008/05/07 01:04:49 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -19,63 +19,65 @@
1919
#include"utils/catcache.h"
2020

2121
/*
22-
*Declarations for util/syscache.c.
23-
*
2422
*SysCache identifiers.
2523
*
26-
*The order of these must match the order
27-
*they are entered into the structure cacheinfo[] in syscache.c.
28-
*Keep them in alphabetical order.
24+
*The order of these identifiers must match the order
25+
*of the entries in the array cacheinfo[] in syscache.c.
26+
*Keep them in alphabetical order (renumbering only costs a
27+
*backend rebuild).
2928
*/
3029

31-
#defineAGGFNOID0
32-
#defineAMNAME1
33-
#defineAMOID2
34-
#defineAMOPOPID3
35-
#defineAMOPSTRATEGY4
36-
#defineAMPROCNUM5
37-
#defineATTNAME6
38-
#defineATTNUM7
39-
#defineAUTHMEMMEMROLE8
40-
#defineAUTHMEMROLEMEM9
41-
#defineAUTHNAME10
42-
#defineAUTHOID11
43-
#defineCASTSOURCETARGET12
44-
#defineCLAAMNAMENSP13
45-
#defineCLAOID14
46-
#defineCONDEFAULT15
47-
#defineCONNAMENSP16
48-
#defineCONSTROID17
49-
#defineCONVOID18
50-
#defineDATABASEOID19
51-
#defineENUMOID20
52-
#defineENUMTYPOIDNAME21
53-
#defineINDEXRELID22
54-
#defineLANGNAME23
55-
#defineLANGOID24
56-
#defineNAMESPACENAME25
57-
#defineNAMESPACEOID26
58-
#defineOPERNAMENSP27
59-
#defineOPEROID28
60-
#defineOPFAMILYAMNAMENSP29
61-
#defineOPFAMILYOID30
62-
#definePROCNAMEARGSNSP31
63-
#definePROCOID32
64-
#defineRELNAMENSP33
65-
#defineRELOID34
66-
#defineRULERELNAME35
67-
#defineSTATRELATT36
68-
#defineTSCONFIGMAP37
69-
#defineTSCONFIGNAMENSP38
70-
#defineTSCONFIGOID39
71-
#defineTSDICTNAMENSP40
72-
#defineTSDICTOID41
73-
#defineTSPARSERNAMENSP42
74-
#defineTSPARSEROID43
75-
#defineTSTEMPLATENAMENSP44
76-
#defineTSTEMPLATEOID45
77-
#defineTYPENAMENSP46
78-
#defineTYPEOID47
30+
enumSysCacheIdentifier
31+
{
32+
AGGFNOID=0,
33+
AMNAME,
34+
AMOID,
35+
AMOPOPID,
36+
AMOPSTRATEGY,
37+
AMPROCNUM,
38+
ATTNAME,
39+
ATTNUM,
40+
AUTHMEMMEMROLE,
41+
AUTHMEMROLEMEM,
42+
AUTHNAME,
43+
AUTHOID,
44+
CASTSOURCETARGET,
45+
CLAAMNAMENSP,
46+
CLAOID,
47+
CONDEFAULT,
48+
CONNAMENSP,
49+
CONSTROID,
50+
CONVOID,
51+
DATABASEOID,
52+
ENUMOID,
53+
ENUMTYPOIDNAME,
54+
INDEXRELID,
55+
LANGNAME,
56+
LANGOID,
57+
NAMESPACENAME,
58+
NAMESPACEOID,
59+
OPERNAMENSP,
60+
OPEROID,
61+
OPFAMILYAMNAMENSP,
62+
OPFAMILYOID,
63+
PROCNAMEARGSNSP,
64+
PROCOID,
65+
RELNAMENSP,
66+
RELOID,
67+
RULERELNAME,
68+
STATRELATT,
69+
TSCONFIGMAP,
70+
TSCONFIGNAMENSP,
71+
TSCONFIGOID,
72+
TSDICTNAMENSP,
73+
TSDICTOID,
74+
TSPARSERNAMENSP,
75+
TSPARSEROID,
76+
TSTEMPLATENAMENSP,
77+
TSTEMPLATEOID,
78+
TYPENAMENSP,
79+
TYPEOID
80+
};
7981

8082
externvoidInitCatalogCache(void);
8183
externvoidInitCatalogCachePhase2(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp