1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Add pg_statistic index, add missing Hiroshi file.

This commit is contained in:
Bruce Momjian
1999-11-24 16:52:50 +00:00
parent 61a93ed2da
commit 74f418eb9a
15 changed files with 183 additions and 101 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.31 1999/11/24 00:44:28 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.32 1999/11/24 16:52:31 momjian Exp $
*
* NOTES
* See acl.h.
@@ -350,7 +350,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
int32 result;
Relation relation;
tuple = SearchSysCacheTuple(USERNAME,
tuple = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -469,7 +469,7 @@ pg_ownercheck(char *usename,
AclId user_id,
owner_id = 0;
tuple = SearchSysCacheTuple(USERNAME,
tuple = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -535,7 +535,7 @@ pg_func_ownercheck(char *usename,
AclId user_id,
owner_id;
tuple = SearchSysCacheTuple(USERNAME,
tuple = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
@@ -577,7 +577,7 @@ pg_aggr_ownercheck(char *usename,
AclId user_id,
owner_id;
tuple = SearchSysCacheTuple(USERNAME,
tuple = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(usename),
0, 0, 0);
if (!HeapTupleIsValid(tuple))

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.51 1999/11/22 17:55:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.52 1999/11/24 16:52:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -880,6 +880,85 @@ RewriteOidIndexScan(Relation heapRelation, Oid rewriteId)
}
HeapTuple
ShadowNameIndexScan(Relation heapRelation, char *useName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(useName));
idesc = index_openr(ShadowNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_INT4EQ,
Int32GetDatum(sysId));
idesc = index_openr(ShadowSysidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
StatisticRelidAttnumOpIndexScan(Relation heapRelation,
Oid relId,
AttrNumber attNum,
Oid op)
{
Relation idesc;
ScanKeyData skey[3];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relId));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_INT2EQ,
Int16GetDatum(attNum));
ScanKeyEntryInitialize(&skey[2],
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(op));
idesc = index_openr(StatisticRelidAttnumOpIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
index_close(idesc);
return tuple;
}
HeapTuple
TypeNameIndexScan(Relation heapRelation, char *typeName)
{
@@ -923,46 +1002,3 @@ TypeOidIndexScan(Relation heapRelation, Oid typeId)
return tuple;
}
HeapTuple
ShadowNameIndexScan(Relation heapRelation, char *useName)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
PointerGetDatum(useName));
idesc = index_openr(ShadowNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_INT4EQ,
Int32GetDatum(sysId));
idesc = index_openr(ShadowSysidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}