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

Commitdaaeafd

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Removed (useless) pg_proc_prosrc_index
Jan
1 parent2993f0c commitdaaeafd

File tree

5 files changed

+26
-48
lines changed

5 files changed

+26
-48
lines changed

‎src/backend/catalog/indexing.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.46 1999/09/29 16:05:56 wieck Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.47 1999/09/30 10:31:42 wieck Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -42,8 +42,7 @@ char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
4242
AttributeNumIndex,
4343
AttributeRelidIndex};
4444
char*Name_pg_proc_indices[Num_pg_proc_indices]= {ProcedureNameIndex,
45-
ProcedureOidIndex,
46-
ProcedureSrcIndex};
45+
ProcedureOidIndex};
4746
char*Name_pg_type_indices[Num_pg_type_indices]= {TypeNameIndex,
4847
TypeOidIndex};
4948
char*Name_pg_class_indices[Num_pg_class_indices]= {ClassNameIndex,
@@ -378,28 +377,6 @@ ProcedureNameIndexScan(Relation heapRelation,
378377
}
379378

380379

381-
HeapTuple
382-
ProcedureSrcIndexScan(RelationheapRelation,text*procSrc)
383-
{
384-
Relationidesc;
385-
ScanKeyDataskey[1];
386-
HeapTupletuple;
387-
388-
ScanKeyEntryInitialize(&skey[0],
389-
(bits16)0x0,
390-
(AttrNumber)1,
391-
(RegProcedure)F_TEXTEQ,
392-
PointerGetDatum(procSrc));
393-
394-
idesc=index_openr(ProcedureSrcIndex);
395-
tuple=CatalogIndexFetchTuple(heapRelation,idesc,skey,1);
396-
397-
index_close(idesc);
398-
399-
returntuple;
400-
}
401-
402-
403380
HeapTuple
404381
TypeOidIndexScan(RelationheapRelation,OidtypeId)
405382
{

‎src/backend/catalog/pg_proc.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.34 1999/09/18 19:06:34 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.35 1999/09/30 10:31:42 wieck Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -64,7 +64,6 @@ ProcedureCreate(char *procedureName,
6464
Oidtypev[8];
6565
Oidrelid;
6666
Oidtoid;
67-
text*prosrctext;
6867
NameDataprocname;
6968
TupleDesctupDesc;
7069

@@ -131,13 +130,30 @@ ProcedureCreate(char *procedureName,
131130
*/
132131
if (!strcmp(procedureName,GENERICSETNAME))
133132
{
133+
#ifdefSETS_FIXED
134+
/* ----------
135+
* The code below doesn't work any more because the
136+
* PROSRC system cache and the pg_proc_prosrc_index
137+
* have been removed. Instead a sequential heap scan
138+
* or something better must get implemented. The reason
139+
* for removing is that nbtree index crashes if sources
140+
* exceed 2K what's likely for procedural languages.
141+
*
142+
* 1999/09/30 Jan
143+
* ----------
144+
*/
145+
text*prosrctext;
146+
134147
prosrctext=textin(prosrc);
135148
tup=SearchSysCacheTuple(PROSRC,
136149
PointerGetDatum(prosrctext),
137150
0,0,0);
138151
pfree(prosrctext);
139152
if (HeapTupleIsValid(tup))
140153
returntup->t_data->t_oid;
154+
#else
155+
elog(ERROR,"lookup for procedure by source needs fix (Jan)");
156+
#endif/* SETS_FIXED */
141157
}
142158
}
143159

‎src/backend/utils/cache/syscache.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.36 1999/09/18 19:07:55 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.37 1999/09/30 10:31:43 wieck Exp $
1111
*
1212
* NOTES
1313
* These routines allow the parser/planner/executor to perform
@@ -336,17 +336,6 @@ static struct cachedesc cacheinfo[] = {
336336
offsetof(FormData_pg_rewrite,ev_qual),
337337
NULL,
338338
(ScanFunc)NULL},
339-
{ProcedureRelationName,/* PROSRC */
340-
1,
341-
{
342-
Anum_pg_proc_prosrc,
343-
0,
344-
0,
345-
0
346-
},
347-
offsetof(FormData_pg_proc,prosrc),
348-
ProcedureSrcIndex,
349-
(ScanFunc)ProcedureSrcIndexScan},
350339
{OperatorClassRelationName,/* CLADEFTYPE */
351340
1,
352341
{

‎src/include/catalog/indexing.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: indexing.h,v 1.24 1999/09/29 16:06:14 wieck Exp $
10+
* $Id: indexing.h,v 1.25 1999/09/30 10:31:44 wieck Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,7 +20,7 @@
2020
* Some definitions for indices on pg_attribute
2121
*/
2222
#defineNum_pg_attr_indices3
23-
#defineNum_pg_proc_indices3
23+
#defineNum_pg_proc_indices2
2424
#defineNum_pg_type_indices2
2525
#defineNum_pg_class_indices2
2626
#defineNum_pg_attrdef_indices1
@@ -37,7 +37,6 @@
3737
#defineAttributeRelidIndex"pg_attribute_attrelid_index"
3838
#defineProcedureOidIndex"pg_proc_oid_index"
3939
#defineProcedureNameIndex"pg_proc_proname_narg_type_index"
40-
#defineProcedureSrcIndex"pg_proc_prosrc_index"
4140
#defineTypeOidIndex"pg_type_oid_index"
4241
#defineTypeNameIndex"pg_type_typname_index"
4342
#defineClassOidIndex"pg_class_oid_index"
@@ -83,7 +82,6 @@ extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
8382
externHeapTupleProcedureOidIndexScan(RelationheapRelation,OidprocId);
8483
externHeapTupleProcedureNameIndexScan(RelationheapRelation,
8584
char*procName,int2nargs,Oid*argTypes);
86-
externHeapTupleProcedureSrcIndexScan(RelationheapRelation,text*procSrc);
8785
externHeapTupleTypeOidIndexScan(RelationheapRelation,OidtypeId);
8886
externHeapTupleTypeNameIndexScan(RelationheapRelation,char*typeName);
8987
externHeapTupleClassNameIndexScan(RelationheapRelation,char*relName);
@@ -103,7 +101,6 @@ DECLARE_INDEX(pg_attribute_attrelid_index on pg_attribute using btree(attrelid o
103101

104102
DECLARE_INDEX(pg_proc_oid_indexonpg_procusingbtree(oidoid_ops));
105103
DECLARE_INDEX(pg_proc_proname_narg_type_indexonpg_procusingbtree(pronamename_ops,pronargsint2_ops,proargtypesoid8_ops));
106-
DECLARE_INDEX(pg_proc_prosrc_indexonpg_procusingbtree(prosrctext_ops));
107104

108105
DECLARE_INDEX(pg_type_oid_indexonpg_typeusingbtree(oidoid_ops));
109106
DECLARE_INDEX(pg_type_typname_indexonpg_typeusingbtree(typnamename_ops));

‎src/include/utils/syscache.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: syscache.h,v 1.18 1999/08/09 03:13:28 tgl Exp $
11+
* $Id: syscache.h,v 1.19 1999/09/30 10:31:47 wieck Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -58,9 +58,8 @@
5858
#defineGRONAME23
5959
#defineGROSYSID24
6060
#defineREWRITENAME25
61-
#definePROSRC26
62-
#defineCLADEFTYPE27
63-
#defineLANOID28
61+
#defineCLADEFTYPE26
62+
#defineLANOID27
6463

6564
/* ----------------
6665
*struct cachedesc:information needed for a call to InitSysCache()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp