Skip to content

Commit daaeafd

Browse files
Jan WieckJan Wieck
authored andcommitted
Removed (useless) pg_proc_prosrc_index
Jan
1 parent 2993f0c commit daaeafd

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(Relation heapRelation, text *procSrc)
383-
{
384-
Relation idesc;
385-
ScanKeyData skey[1];
386-
HeapTuple tuple;
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-
return tuple;
400-
}
401-
402-
403380
HeapTuple
404381
TypeOidIndexScan(Relation heapRelation, Oid typeId)
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
Oid typev[8];
6565
Oid relid;
6666
Oid toid;
67-
text *prosrctext;
6867
NameData procname;
6968
TupleDesc tupDesc;
7069

@@ -131,13 +130,30 @@ ProcedureCreate(char *procedureName,
131130
*/
132131
if (!strcmp(procedureName, GENERICSETNAME))
133132
{
133+
#ifdef SETS_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
return tup->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
#define Num_pg_attr_indices 3
23-
#define Num_pg_proc_indices 3
23+
#define Num_pg_proc_indices 2
2424
#define Num_pg_type_indices 2
2525
#define Num_pg_class_indices 2
2626
#define Num_pg_attrdef_indices 1
@@ -37,7 +37,6 @@
3737
#define AttributeRelidIndex "pg_attribute_attrelid_index"
3838
#define ProcedureOidIndex "pg_proc_oid_index"
3939
#define ProcedureNameIndex "pg_proc_proname_narg_type_index"
40-
#define ProcedureSrcIndex "pg_proc_prosrc_index"
4140
#define TypeOidIndex "pg_type_oid_index"
4241
#define TypeNameIndex "pg_type_typname_index"
4342
#define ClassOidIndex "pg_class_oid_index"
@@ -83,7 +82,6 @@ extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
8382
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
8483
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
8584
char *procName, int2 nargs, Oid *argTypes);
86-
extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
8785
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
8886
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
8987
extern HeapTuple ClassNameIndexScan(Relation heapRelation, 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_index on pg_proc using btree(oid oid_ops));
105103
DECLARE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oid8_ops));
106-
DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops));
107104

108105
DECLARE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops));
109106
DECLARE_INDEX(pg_type_typname_index on pg_type using btree(typname name_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
#define GRONAME 23
5959
#define GROSYSID 24
6060
#define REWRITENAME 25
61-
#define PROSRC 26
62-
#define CLADEFTYPE 27
63-
#define LANOID 28
61+
#define CLADEFTYPE 26
62+
#define LANOID 27
6463

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy