aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/acl.c6
-rw-r--r--src/backend/utils/adt/ruleutils.c4
-rw-r--r--src/backend/utils/cache/syscache.c60
-rw-r--r--src/backend/utils/init/miscinit.c4
-rw-r--r--src/backend/utils/misc/superuser.c4
5 files changed, 45 insertions, 33 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 15db9b30416..ee3c41ace6c 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.42 1999/11/22 17:56:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.43 1999/11/24 16:52:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -170,7 +170,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg)
switch (aip->ai_idtype)
{
case ACL_IDTYPE_UID:
- htup = SearchSysCacheTuple(USERNAME,
+ htup = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(name),
0, 0, 0);
if (!HeapTupleIsValid(htup))
@@ -281,7 +281,7 @@ aclitemout(AclItem *aip)
switch (aip->ai_idtype)
{
case ACL_IDTYPE_UID:
- htup = SearchSysCacheTuple(USERSYSID,
+ htup = SearchSysCacheTuple(SHADOWSYSID,
ObjectIdGetDatum(aip->ai_id),
0, 0, 0);
if (!HeapTupleIsValid(htup))
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index a342daba8ba..a4f182770b9 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
* out of it's tuple
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.32 1999/11/22 17:56:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.33 1999/11/24 16:52:37 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -567,7 +567,7 @@ pg_get_userbyid(int32 uid)
* Get the pg_shadow entry and print the result
* ----------
*/
- usertup = SearchSysCacheTuple(USERSYSID,
+ usertup = SearchSysCacheTuple(SHADOWSYSID,
ObjectIdGetDatum(uid), 0, 0, 0);
if (HeapTupleIsValid(usertup))
{
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index e14f27da8c9..d3e0648695d 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.42 1999/11/24 00:58:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.43 1999/11/24 16:52:38 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -66,7 +66,8 @@ typedef HeapTuple (*ScanFunc) ();
lookups return only one row, so the index should be unique.
In backend/catalog/indexing.c, initialize the relation array with
- the index names for the relation, and create the index lookup function.
+ the index names for the relation, fixed size of relation (or marking
+ first non-fixed length field), and create the index lookup function.
Pick one that takes similar arguments and use that one, but keep the
function names in the same order as the cache list for clarity.
@@ -333,52 +334,63 @@ static struct cachedesc cacheinfo[] = {
offsetof(FormData_pg_rewrite, ev_qual),
RewriteOidIndex,
RewriteOidIndexScan},
- {TypeRelationName, /* TYPENAME */
+ {ShadowRelationName, /* SHADOWNAME */
1,
{
- Anum_pg_type_typname,
+ Anum_pg_shadow_usename,
0,
0,
0
},
- offsetof(FormData_pg_type, typalign) +sizeof(char),
- TypeNameIndex,
- TypeNameIndexScan},
- {TypeRelationName, /* TYPEOID */
+ sizeof(FormData_pg_shadow),
+NULL,NULL
+/* ShadowNameIndex,
+ ShadowNameIndexScan*/},
+ {ShadowRelationName, /* SHADOWSYSID */
1,
{
- ObjectIdAttributeNumber,
+ Anum_pg_shadow_usesysid,
0,
0,
0
},
- offsetof(FormData_pg_type, typalign) +sizeof(char),
- TypeOidIndex,
- TypeOidIndexScan},
- {ShadowRelationName, /* USERNAME */
+ sizeof(FormData_pg_shadow),
+NULL,NULL
+/* ShadowSysidIndex,
+ ShadowSysidIndexScan*/},
+ {StatisticRelationName, /* STATRELID */
+ 3,
+ {
+ Anum_pg_statistic_starelid,
+ Anum_pg_statistic_staattnum,
+ Anum_pg_statistic_staop,
+ 0
+ },
+ offsetof(FormData_pg_statistic, stacommonval),
+ StatisticRelidAttnumOpIndex,
+ StatisticRelidAttnumOpIndexScan},
+ {TypeRelationName, /* TYPENAME */
1,
{
- Anum_pg_shadow_usename,
+ Anum_pg_type_typname,
0,
0,
0
},
- sizeof(FormData_pg_shadow),
-NULL,NULL
-/* ShadowNameIndex,
- ShadowNameIndexScan*/},
- {ShadowRelationName, /* USERSYSID */
+ offsetof(FormData_pg_type, typalign) +sizeof(char),
+ TypeNameIndex,
+ TypeNameIndexScan},
+ {TypeRelationName, /* TYPEOID */
1,
{
- Anum_pg_shadow_usesysid,
+ ObjectIdAttributeNumber,
0,
0,
0
},
- sizeof(FormData_pg_shadow),
-NULL,NULL
-/* ShadowSysidIndex,
- ShadowSysidIndexScan*/}
+ offsetof(FormData_pg_type, typalign) +sizeof(char),
+ TypeOidIndex,
+ TypeOidIndexScan}
};
static struct catcache *SysCache[lengthof(cacheinfo)];
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index 0f6c376e8a0..18eed64195f 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.36 1999/11/22 17:56:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.37 1999/11/24 16:52:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -453,7 +453,7 @@ SetUserId()
}
userName = GetPgUserName();
- userTup = SearchSysCacheTuple(USERNAME,
+ userTup = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(userName),
0, 0, 0);
if (!HeapTupleIsValid(userTup))
diff --git a/src/backend/utils/misc/superuser.c b/src/backend/utils/misc/superuser.c
index cffaacdd7fa..c1f0a3231db 100644
--- a/src/backend/utils/misc/superuser.c
+++ b/src/backend/utils/misc/superuser.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.11 1999/11/22 17:56:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/superuser.c,v 1.12 1999/11/24 16:52:45 momjian Exp $
*
* DESCRIPTION
* See superuser().
@@ -30,7 +30,7 @@ superuser(void)
HeapTuple utup;
- utup = SearchSysCacheTuple(USERNAME,
+ utup = SearchSysCacheTuple(SHADOWNAME,
PointerGetDatum(UserName),
0, 0, 0);
Assert(utup != NULL);