mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 01:21:49 +02:00
Removed (useless) pg_proc_prosrc_index
Jan
This commit is contained in:
parent
2993f0c100
commit
daaeafd9e1
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.46 1999/09/29 16:05:56 wieck Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.47 1999/09/30 10:31:42 wieck Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,8 +42,7 @@ char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
|
|||||||
AttributeNumIndex,
|
AttributeNumIndex,
|
||||||
AttributeRelidIndex};
|
AttributeRelidIndex};
|
||||||
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
|
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
|
||||||
ProcedureOidIndex,
|
ProcedureOidIndex};
|
||||||
ProcedureSrcIndex};
|
|
||||||
char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
|
char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
|
||||||
TypeOidIndex};
|
TypeOidIndex};
|
||||||
char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
|
char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
|
||||||
@ -378,28 +377,6 @@ ProcedureNameIndexScan(Relation heapRelation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HeapTuple
|
|
||||||
ProcedureSrcIndexScan(Relation heapRelation, text *procSrc)
|
|
||||||
{
|
|
||||||
Relation idesc;
|
|
||||||
ScanKeyData skey[1];
|
|
||||||
HeapTuple tuple;
|
|
||||||
|
|
||||||
ScanKeyEntryInitialize(&skey[0],
|
|
||||||
(bits16) 0x0,
|
|
||||||
(AttrNumber) 1,
|
|
||||||
(RegProcedure) F_TEXTEQ,
|
|
||||||
PointerGetDatum(procSrc));
|
|
||||||
|
|
||||||
idesc = index_openr(ProcedureSrcIndex);
|
|
||||||
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
|
|
||||||
|
|
||||||
index_close(idesc);
|
|
||||||
|
|
||||||
return tuple;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HeapTuple
|
HeapTuple
|
||||||
TypeOidIndexScan(Relation heapRelation, Oid typeId)
|
TypeOidIndexScan(Relation heapRelation, Oid typeId)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.34 1999/09/18 19:06:34 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.35 1999/09/30 10:31:42 wieck Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -64,7 +64,6 @@ ProcedureCreate(char *procedureName,
|
|||||||
Oid typev[8];
|
Oid typev[8];
|
||||||
Oid relid;
|
Oid relid;
|
||||||
Oid toid;
|
Oid toid;
|
||||||
text *prosrctext;
|
|
||||||
NameData procname;
|
NameData procname;
|
||||||
TupleDesc tupDesc;
|
TupleDesc tupDesc;
|
||||||
|
|
||||||
@ -131,6 +130,20 @@ ProcedureCreate(char *procedureName,
|
|||||||
*/
|
*/
|
||||||
if (!strcmp(procedureName, GENERICSETNAME))
|
if (!strcmp(procedureName, GENERICSETNAME))
|
||||||
{
|
{
|
||||||
|
#ifdef SETS_FIXED
|
||||||
|
/* ----------
|
||||||
|
* The code below doesn't work any more because the
|
||||||
|
* PROSRC system cache and the pg_proc_prosrc_index
|
||||||
|
* have been removed. Instead a sequential heap scan
|
||||||
|
* or something better must get implemented. The reason
|
||||||
|
* for removing is that nbtree index crashes if sources
|
||||||
|
* exceed 2K what's likely for procedural languages.
|
||||||
|
*
|
||||||
|
* 1999/09/30 Jan
|
||||||
|
* ----------
|
||||||
|
*/
|
||||||
|
text *prosrctext;
|
||||||
|
|
||||||
prosrctext = textin(prosrc);
|
prosrctext = textin(prosrc);
|
||||||
tup = SearchSysCacheTuple(PROSRC,
|
tup = SearchSysCacheTuple(PROSRC,
|
||||||
PointerGetDatum(prosrctext),
|
PointerGetDatum(prosrctext),
|
||||||
@ -138,6 +151,9 @@ ProcedureCreate(char *procedureName,
|
|||||||
pfree(prosrctext);
|
pfree(prosrctext);
|
||||||
if (HeapTupleIsValid(tup))
|
if (HeapTupleIsValid(tup))
|
||||||
return tup->t_data->t_oid;
|
return tup->t_data->t_oid;
|
||||||
|
#else
|
||||||
|
elog(ERROR, "lookup for procedure by source needs fix (Jan)");
|
||||||
|
#endif /* SETS_FIXED */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
src/backend/utils/cache/syscache.c
vendored
13
src/backend/utils/cache/syscache.c
vendored
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.36 1999/09/18 19:07:55 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.37 1999/09/30 10:31:43 wieck Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* These routines allow the parser/planner/executor to perform
|
* These routines allow the parser/planner/executor to perform
|
||||||
@ -336,17 +336,6 @@ static struct cachedesc cacheinfo[] = {
|
|||||||
offsetof(FormData_pg_rewrite, ev_qual),
|
offsetof(FormData_pg_rewrite, ev_qual),
|
||||||
NULL,
|
NULL,
|
||||||
(ScanFunc) NULL},
|
(ScanFunc) NULL},
|
||||||
{ProcedureRelationName, /* PROSRC */
|
|
||||||
1,
|
|
||||||
{
|
|
||||||
Anum_pg_proc_prosrc,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
},
|
|
||||||
offsetof(FormData_pg_proc, prosrc),
|
|
||||||
ProcedureSrcIndex,
|
|
||||||
(ScanFunc) ProcedureSrcIndexScan},
|
|
||||||
{OperatorClassRelationName, /* CLADEFTYPE */
|
{OperatorClassRelationName, /* CLADEFTYPE */
|
||||||
1,
|
1,
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: indexing.h,v 1.24 1999/09/29 16:06:14 wieck Exp $
|
* $Id: indexing.h,v 1.25 1999/09/30 10:31:44 wieck Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -20,7 +20,7 @@
|
|||||||
* Some definitions for indices on pg_attribute
|
* Some definitions for indices on pg_attribute
|
||||||
*/
|
*/
|
||||||
#define Num_pg_attr_indices 3
|
#define Num_pg_attr_indices 3
|
||||||
#define Num_pg_proc_indices 3
|
#define Num_pg_proc_indices 2
|
||||||
#define Num_pg_type_indices 2
|
#define Num_pg_type_indices 2
|
||||||
#define Num_pg_class_indices 2
|
#define Num_pg_class_indices 2
|
||||||
#define Num_pg_attrdef_indices 1
|
#define Num_pg_attrdef_indices 1
|
||||||
@ -37,7 +37,6 @@
|
|||||||
#define AttributeRelidIndex "pg_attribute_attrelid_index"
|
#define AttributeRelidIndex "pg_attribute_attrelid_index"
|
||||||
#define ProcedureOidIndex "pg_proc_oid_index"
|
#define ProcedureOidIndex "pg_proc_oid_index"
|
||||||
#define ProcedureNameIndex "pg_proc_proname_narg_type_index"
|
#define ProcedureNameIndex "pg_proc_proname_narg_type_index"
|
||||||
#define ProcedureSrcIndex "pg_proc_prosrc_index"
|
|
||||||
#define TypeOidIndex "pg_type_oid_index"
|
#define TypeOidIndex "pg_type_oid_index"
|
||||||
#define TypeNameIndex "pg_type_typname_index"
|
#define TypeNameIndex "pg_type_typname_index"
|
||||||
#define ClassOidIndex "pg_class_oid_index"
|
#define ClassOidIndex "pg_class_oid_index"
|
||||||
@ -83,7 +82,6 @@ extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
|
|||||||
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
|
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
|
||||||
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
|
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
|
||||||
char *procName, int2 nargs, Oid *argTypes);
|
char *procName, int2 nargs, Oid *argTypes);
|
||||||
extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
|
|
||||||
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
|
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
|
||||||
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
|
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
|
||||||
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
|
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
|
||||||
@ -103,7 +101,6 @@ DECLARE_INDEX(pg_attribute_attrelid_index on pg_attribute using btree(attrelid o
|
|||||||
|
|
||||||
DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops));
|
DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops));
|
||||||
DECLARE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oid8_ops));
|
DECLARE_INDEX(pg_proc_proname_narg_type_index on pg_proc using btree(proname name_ops, pronargs int2_ops, proargtypes oid8_ops));
|
||||||
DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops));
|
|
||||||
|
|
||||||
DECLARE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops));
|
DECLARE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops));
|
||||||
DECLARE_INDEX(pg_type_typname_index on pg_type using btree(typname name_ops));
|
DECLARE_INDEX(pg_type_typname_index on pg_type using btree(typname name_ops));
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: syscache.h,v 1.18 1999/08/09 03:13:28 tgl Exp $
|
* $Id: syscache.h,v 1.19 1999/09/30 10:31:47 wieck Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -58,9 +58,8 @@
|
|||||||
#define GRONAME 23
|
#define GRONAME 23
|
||||||
#define GROSYSID 24
|
#define GROSYSID 24
|
||||||
#define REWRITENAME 25
|
#define REWRITENAME 25
|
||||||
#define PROSRC 26
|
#define CLADEFTYPE 26
|
||||||
#define CLADEFTYPE 27
|
#define LANOID 27
|
||||||
#define LANOID 28
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* struct cachedesc: information needed for a call to InitSysCache()
|
* struct cachedesc: information needed for a call to InitSysCache()
|
||||||
|
Loading…
Reference in New Issue
Block a user