1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add system indexes to match all caches.

Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.
This commit is contained in:
Bruce Momjian
1999-11-22 17:56:41 +00:00
parent e30c2d67ef
commit fc955b14ea
75 changed files with 1265 additions and 634 deletions

View File

@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.123 1999/10/23 03:13:26 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.124 1999/11/22 17:56:36 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@@ -1096,8 +1096,8 @@ clearInhInfo(InhInfo *inh, int numInherits)
return;
for (i = 0; i < numInherits; ++i)
{
if (inh[i].inhrel)
free(inh[i].inhrel);
if (inh[i].inhrelid)
free(inh[i].inhrelid);
if (inh[i].inhparent)
free(inh[i].inhparent);
}
@@ -1478,7 +1478,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
sprintf(query, "SELECT rcname from pg_relcheck, pg_inherits as i "
"where rcrelid = '%s'::oid "
" and rcrelid = i.inhrel"
" and rcrelid = i.inhrelid"
" and exists "
" (select * from pg_relcheck as c "
" where c.rcname = pg_relcheck.rcname "
@@ -1523,7 +1523,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
"where rcrelid = '%s'::oid "
" and not exists "
" (select * from pg_relcheck as c, pg_inherits as i "
" where i.inhrel = pg_relcheck.rcrelid "
" where i.inhrelid = pg_relcheck.rcrelid "
" and c.rcname = pg_relcheck.rcname "
" and c.rcsrc = pg_relcheck.rcsrc "
" and c.rcrelid = i.inhparent) ",
@@ -1738,12 +1738,12 @@ getInherits(int *numInherits)
char query[MAX_QUERY_SIZE];
InhInfo *inhinfo;
int i_inhrel;
int i_inhrelid;
int i_inhparent;
/* find all the inheritance information */
sprintf(query, "SELECT inhrel, inhparent from pg_inherits");
sprintf(query, "SELECT inhrelid, inhparent from pg_inherits");
res = PQexec(g_conn, query);
if (!res ||
@@ -1759,12 +1759,12 @@ getInherits(int *numInherits)
inhinfo = (InhInfo *) malloc(ntups * sizeof(InhInfo));
i_inhrel = PQfnumber(res, "inhrel");
i_inhrelid = PQfnumber(res, "inhrelid");
i_inhparent = PQfnumber(res, "inhparent");
for (i = 0; i < ntups; i++)
{
inhinfo[i].inhrel = strdup(PQgetvalue(res, i, i_inhrel));
inhinfo[i].inhrelid = strdup(PQgetvalue(res, i, i_inhrelid));
inhinfo[i].inhparent = strdup(PQgetvalue(res, i, i_inhparent));
}