oid_names.diff

text/plain

Filename: oid_names.diff
Type: text/plain
Part: 0
Message: filename patch (was Re: [HACKERS] Big 7.1 open items)

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
backend/catalog/heap.c 38 1
backend/commands/rename.c 5 0
backend/parser/analyze.c 1 1
backend/postmaster/postmaster.c 4 2
backend/storage/lmgr/lmgr.c 1 1
backend/utils/cache/relcache.c 13 3
backend/utils/init/globals.c 7 0
backend/utils/misc/database.c 2 2
include/catalog/catname.h 7 0
include/catalog/pg_attribute.h 40 38
include/catalog/pg_class.h 37 34
include/parser/analyze.h 4 0
include/utils/rel.h 11 4
Index: backend/catalog/heap.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/catalog/heap.c,v
retrieving revision 1.131
diff -u -r1.131 heap.c
--- backend/catalog/heap.c	2000/06/15 03:32:01	1.131
+++ backend/catalog/heap.c	2000/06/15 22:52:22
@@ -56,6 +56,7 @@
 #include "parser/parse_relation.h"
 #include "parser/parse_target.h"
 #include "parser/parse_type.h"
+#include "parser/analyze.h" /* for makeObjectName */
 #include "rewrite/rewriteRemove.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
@@ -187,6 +188,8 @@
 	int			i;
 	Oid			relid;
 	Relation	rel;
+	char		*relphysname;
+	char		*tmpname;
 	int			len;
 	bool		nailme = false;
 	int			natts = tupDesc->natts;
@@ -242,6 +245,31 @@
 		relid = RelOid_pg_type;
 		nailme = true;
 	}
+	else if (relname && !strcmp(DatabaseRelationName, relname))
+	{
+		relid = RelOid_pg_database;
+		nailme = true;
+	}
+	else if (relname && !strcmp(GroupRelationName, relname))
+	{
+		relid = RelOid_pg_group;
+		nailme = true;
+	}
+	else if (relname && !strcmp(LogRelationName, relname))
+	{
+		relid = RelOid_pg_log;
+		nailme = true;
+	}
+	else if (relname && !strcmp(ShadowRelationName, relname))
+	{
+		relid = RelOid_pg_shadow;
+		nailme = true;
+	}
+	else if (relname && !strcmp(VariableRelationName, relname))
+	{
+		relid = RelOid_pg_variable;
+		nailme = true;
+	}
 	else
 		relid = newoid();
 
@@ -259,6 +287,14 @@
 		snprintf(relname, NAMEDATALEN, "pg_temp.%d.%u", MyProcPid, uniqueId++);
 	}
 
+	/* now that we have the oid and name, we can set the physical filename
+	 * Use makeObjectName() since we need to store this in a fix length
+	 * (NAMEDATALEN) Name field and don't want the OID part truncated
+	 */
+	tmpname = palloc(NAMEDATALEN);
+	snprintf(tmpname, NAMEDATALEN, "%d", relid);
+	relphysname = makeObjectName(relname,NULL,tmpname);
+
 	/* ----------------
 	 *	allocate a new relation descriptor.
 	 * ----------------
@@ -293,7 +329,8 @@
 	 * ----------------
 	 */
 	MemSet((char *) rel->rd_rel, 0, sizeof *rel->rd_rel);
-	strcpy(RelationGetPhysicalRelationName(rel), relname);
+	strcpy(RelationGetRelationName(rel), relname);
+	strcpy(RelationGetPhysicalRelationName(rel), relphysname);
 	rel->rd_rel->relkind = RELKIND_UNCATALOGED;
 	rel->rd_rel->relnatts = natts;
 	if (tupDesc->constr)
Index: backend/commands/rename.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/commands/rename.c,v
retrieving revision 1.45
diff -u -r1.45 rename.c
--- backend/commands/rename.c	2000/05/25 21:30:20	1.45
+++ backend/commands/rename.c	2000/06/15 22:52:22
@@ -312,6 +312,10 @@
 	 * XXX smgr.c ought to provide an interface for this; doing it directly
 	 * is bletcherous.
 	 */
+#ifdef NOT_USED
+	/* took this out to try OID only filenames, left it out while
+	trying relname_oid names  RJR */
+
 	strcpy(oldpath, relpath(oldrelname));
 	strcpy(newpath, relpath(newrelname));
 	if (rename(oldpath, newpath) < 0)
@@ -333,4 +337,5 @@
 				 toldpath, tnewpath);
 		}
 	}
+#endif /* oidnames */
 }
Index: backend/parser/analyze.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/parser/analyze.c,v
retrieving revision 1.147
diff -u -r1.147 analyze.c
--- backend/parser/analyze.c	2000/06/12 19:40:40	1.147
+++ backend/parser/analyze.c	2000/06/15 22:52:22
@@ -498,7 +498,7 @@
  *	from the truncated characters.	Currently it seems best to keep it simple,
  *	so that the generated names are easily predictable by a person.
  */
-static char *
+char *
 makeObjectName(char *name1, char *name2, char *typename)
 {
 	char	   *name;
Index: backend/postmaster/postmaster.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/postmaster/postmaster.c,v
retrieving revision 1.148
diff -u -r1.148 postmaster.c
--- backend/postmaster/postmaster.c	2000/06/14 18:17:38	1.148
+++ backend/postmaster/postmaster.c	2000/06/15 22:52:23
@@ -47,6 +47,7 @@
 #include <fcntl.h>
 #include <time.h>
 #include <sys/param.h>
+#include <catalog/catname.h>
 
  /* moved here to prevent double define */
 #ifdef HAVE_NETDB_H
@@ -316,8 +317,9 @@
 		char		path[MAXPGPATH];
 		FILE	   *fp;
 
-		snprintf(path, sizeof(path), "%s%cbase%ctemplate1%cpg_class",
-				 DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR);
+		snprintf(path, sizeof(path), "%s%cbase%ctemplate1%c%s",
+				DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR,RelationPhysicalRelationName);
+
 		fp = AllocateFile(path, PG_BINARY_R);
 		if (fp == NULL)
 		{
Index: backend/storage/lmgr/lmgr.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v
retrieving revision 1.41
diff -u -r1.41 lmgr.c
--- backend/storage/lmgr/lmgr.c	2000/06/08 22:37:24	1.41
+++ backend/storage/lmgr/lmgr.c	2000/06/15 22:52:23
@@ -112,7 +112,7 @@
 	Assert(RelationIsValid(relation));
 	Assert(OidIsValid(RelationGetRelid(relation)));
 
-	relname = (char *) RelationGetPhysicalRelationName(relation);
+	relname = (char *) RelationGetRelationName(relation);
 
 	relation->rd_lockInfo.lockRelId.relId = RelationGetRelid(relation);
 
Index: backend/utils/cache/relcache.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/utils/cache/relcache.c,v
retrieving revision 1.99
diff -u -r1.99 relcache.c
--- backend/utils/cache/relcache.c	2000/06/02 15:57:30	1.99
+++ backend/utils/cache/relcache.c	2000/06/15 22:52:24
@@ -60,6 +60,7 @@
 #include "utils/fmgroids.h"
 #include "utils/relcache.h"
 #include "utils/temprel.h"
+#include "parser/analyze.h" /* for makeObjectName */
 
 
 /* ----------------
@@ -128,7 +129,7 @@
 do { \
 	RelIdCacheEnt *idhentry; RelNameCacheEnt *namehentry; \
 	char *relname; Oid reloid; bool found; \
-	relname = RelationGetPhysicalRelationName(RELATION); \
+	relname = RelationGetRealRelationName(RELATION); \
 	namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
 											   relname, \
 											   HASH_ENTER, \
@@ -181,7 +182,7 @@
 do { \
 	RelNameCacheEnt *namehentry; RelIdCacheEnt *idhentry; \
 	char *relname; Oid reloid; bool found; \
-	relname = RelationGetPhysicalRelationName(RELATION); \
+	relname = RelationGetRealRelationName(RELATION); \
 	namehentry = (RelNameCacheEnt*)hash_search(RelationNameCache, \
 											   relname, \
 											   HASH_REMOVE, \
@@ -1055,6 +1056,7 @@
 	Relation	relation;
 	Size		len;
 	u_int		i;
+	char		*tmpname;
 
 	/* ----------------
 	 *	allocate new relation desc
@@ -1083,7 +1085,7 @@
 	relation->rd_rel = (Form_pg_class)
 		palloc((Size) (sizeof(*relation->rd_rel)));
 	MemSet(relation->rd_rel, 0, sizeof(FormData_pg_class));
-	strcpy(RelationGetPhysicalRelationName(relation), relationName);
+	strcpy(RelationGetRealRelationName(relation), relationName);
 
 	/* ----------------
 	   initialize attribute tuple form
@@ -1131,6 +1133,14 @@
 	 * ----------------
 	 */
 	RelationGetRelid(relation) = relation->rd_att->attrs[0]->attrelid;
+
+	/* ----------------
+	 *	initialize relation physical name, now that we have the oid
+	 * ----------------
+	 */
+	tmpname = palloc(NAMEDATALEN);
+	snprintf(tmpname, NAMEDATALEN, "%u", RelationGetRelid(relation));
+	strcpy (RelationGetPhysicalRelationName(relation), makeObjectName(relationName,NULL,tmpname));
 
 	/* ----------------
 	 *	initialize the relation lock manager information
Index: backend/utils/init/globals.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/utils/init/globals.c,v
retrieving revision 1.45
diff -u -r1.45 globals.c
--- backend/utils/init/globals.c	2000/05/31 00:28:32	1.45
+++ backend/utils/init/globals.c	2000/06/15 22:52:24
@@ -113,6 +113,8 @@
  *		is done on it in catalog.c!
  *
  *		XXX this is a serious hack which should be fixed -cim 1/26/90
+ *		XXX Really bogus addition of fixed OIDs, to test
+ *		relname -> filename linkage  (RJR 08Feb2000)
  * ----------------
  */
 char	   *SharedSystemRelationNames[] = {
@@ -123,5 +125,10 @@
 	LogRelationName,
 	ShadowRelationName,
 	VariableRelationName,
+	DatabasePhysicalRelationName,
+	GroupPhysicalRelationName,
+	LogPhysicalRelationName,
+	ShadowPhysicalRelationName,
+	VariablePhysicalRelationName,
 	0
 };
Index: backend/utils/misc/database.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/utils/misc/database.c,v
retrieving revision 1.38
diff -u -r1.38 database.c
--- backend/utils/misc/database.c	2000/06/02 15:57:34	1.38
+++ backend/utils/misc/database.c	2000/06/15 22:52:24
@@ -143,8 +143,8 @@
 	char	   *dbfname;
 	Form_pg_database tup_db;
 
-	dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2);
-	sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName);
+	dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabasePhysicalRelationName) + 2);
+	sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabasePhysicalRelationName);
 
 	if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)
 		elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno));
Index: include/catalog/catname.h
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/catalog/catname.h,v
retrieving revision 1.12
diff -u -r1.12 catname.h
--- include/catalog/catname.h	2000/01/26 05:57:56	1.12
+++ include/catalog/catname.h	2000/06/15 22:52:25
@@ -45,6 +45,13 @@
 #define  RelCheckRelationName "pg_relcheck"
 #define  TriggerRelationName "pg_trigger"
 
+#define	DatabasePhysicalRelationName 	"pg_database_1262"
+#define	GroupPhysicalRelationName   	"pg_group_1261"
+#define	LogPhysicalRelationName 	 	"pg_log_1269"
+#define	ShadowPhysicalRelationName 	 	"pg_shadow_1260"
+#define	VariablePhysicalRelationName 	"pg_variable_1264"
+#define	RelationPhysicalRelationName	"pg_class_1259"
+
 extern char *SharedSystemRelationNames[];
 
 #endif	 /* CATNAME_H */
Index: include/catalog/pg_attribute.h
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/catalog/pg_attribute.h,v
retrieving revision 1.59
diff -u -r1.59 pg_attribute.h
--- include/catalog/pg_attribute.h	2000/06/12 03:40:52	1.59
+++ include/catalog/pg_attribute.h	2000/06/15 22:52:25
@@ -412,46 +412,48 @@
  */
 #define Schema_pg_class \
 { 1259, {"relname"},	   19, 0, NAMEDATALEN,	1, 0, -1, -1, '\0', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"reltype"},	   26, 0,	4,	2, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"relowner"},	   23, 0,	4,	3, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"relam"},		   26, 0,	4,	4, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"relpages"},	   23, 0,	4,	5, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"reltuples"},	   23, 0,	4,	6, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"rellongrelid"},  26, 0,	4,	7, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
-{ 1259, {"relhasindex"},   16, 0,	1,	8, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relisshared"},   16, 0,	1,	9, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relkind"},	   18, 0,	1, 10, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relnatts"},	   21, 0,	2, 11, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"relchecks"},	   21, 0,	2, 12, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"reltriggers"},   21, 0,	2, 13, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"relukeys"},	   21, 0,	2, 14, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"relfkeys"},	   21, 0,	2, 15, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"relrefs"},	   21, 0,	2, 16, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
-{ 1259, {"relhaspkey"},    16, 0,	1, 17, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relhasrules"},   16, 0,	1, 18, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relhassubclass"},16, 0,	1, 19, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
-{ 1259, {"relacl"},		 1034, 0,  -1, 20, 0, -1, -1,	'\0', 'p', '\0', 'i', '\0', '\0' }
+{ 1259, {"relphysname"},   19, 0, NAMEDATALEN,	2, 0, -1, -1, '\0', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"reltype"},	   26, 0,	4,	3, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"relowner"},	   23, 0,	4,	4, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"relam"},		   26, 0,	4,	5, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"relpages"},	   23, 0,	4,	6, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"reltuples"},	   23, 0,	4,	7, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"rellongrelid"},  26, 0,	4,	8, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0' }, \
+{ 1259, {"relhasindex"},   16, 0,	1,	9, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relisshared"},   16, 0,	1, 10, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relkind"},	   18, 0,	1, 11, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relnatts"},	   21, 0,	2, 12, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"relchecks"},	   21, 0,	2, 13, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"reltriggers"},   21, 0,	2, 14, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"relukeys"},	   21, 0,	2, 15, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"relfkeys"},	   21, 0,	2, 16, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"relrefs"},	   21, 0,	2, 17, 0, -1, -1, '\001', 'p', '\0', 's', '\0', '\0' }, \
+{ 1259, {"relhaspkey"},    16, 0,	1, 18, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relhasrules"},   16, 0,	1, 19, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relhassubclass"},16, 0,	1, 20, 0, -1, -1, '\001', 'p', '\0', 'c', '\0', '\0' }, \
+{ 1259, {"relacl"},		 1034, 0,  -1, 21, 0, -1, -1,	'\0', 'p', '\0', 'i', '\0', '\0' }
 
 DATA(insert OID = 0 ( 1259 relname			19 0 NAMEDATALEN   1 0 -1 -1 f p f i f f));
-DATA(insert OID = 0 ( 1259 reltype			26 0  4   2 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relowner			23 0  4   3 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relam			26 0  4   4 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relpages			23 0  4   5 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 reltuples		23 0  4   6 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 rellongrelid		26 0  4   7 0 -1 -1 t p f i f f));
-DATA(insert OID = 0 ( 1259 relhasindex		16 0  1   8 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relisshared		16 0  1   9 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relkind			18 0  1  10 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relnatts			21 0  2  11 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relchecks		21 0  2  12 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 reltriggers		21 0  2  13 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relukeys			21 0  2  14 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relfkeys			21 0  2  15 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relrefs			21 0  2  16 0 -1 -1 t p f s f f));
-DATA(insert OID = 0 ( 1259 relhaspkey		16 0  1  17 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relhasrules		16 0  1  18 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relhassubclass	16 0  1   19 0 -1 -1 t p f c f f));
-DATA(insert OID = 0 ( 1259 relacl		  1034 0 -1  20 0 -1 -1 f p f i f f));
+DATA(insert OID = 0 ( 1259 relphysname			19 0 NAMEDATALEN   2 0 -1 -1 f p f i f f));
+DATA(insert OID = 0 ( 1259 reltype			26 0  4   3 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 relowner			23 0  4   4 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 relam			26 0  4   5 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 relpages			23 0  4   6 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 reltuples		23 0  4   7 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 rellongrelid		26 0  4   8 0 -1 -1 t p f i f f));
+DATA(insert OID = 0 ( 1259 relhasindex		16 0  1   9 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relisshared		16 0  1  10 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relkind			18 0  1  11 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relnatts			21 0  2  12 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 relchecks		21 0  2  13 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 reltriggers		21 0  2  14 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 relukeys			21 0  2  15 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 relfkeys			21 0  2  16 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 relrefs			21 0  2  17 0 -1 -1 t p f s f f));
+DATA(insert OID = 0 ( 1259 relhaspkey		16 0  1  18 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relhasrules		16 0  1  19 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relhassubclass	16 0  1   20 0 -1 -1 t p f c f f));
+DATA(insert OID = 0 ( 1259 relacl		  1034 0 -1  21 0 -1 -1 f p f i f f));
 DATA(insert OID = 0 ( 1259 ctid				27 0  6  -1 0 -1 -1 f p f i f f));
 DATA(insert OID = 0 ( 1259 oid				26 0  4  -2 0 -1 -1 t p f i f f));
 DATA(insert OID = 0 ( 1259 xmin				28 0  4  -3 0 -1 -1 t p f i f f));
Index: include/catalog/pg_class.h
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/catalog/pg_class.h,v
retrieving revision 1.37
diff -u -r1.37 pg_class.h
--- include/catalog/pg_class.h	2000/06/12 03:40:53	1.37
+++ include/catalog/pg_class.h	2000/06/15 22:52:25
@@ -54,6 +54,7 @@
 CATALOG(pg_class) BOOTSTRAP
 {
 	NameData	relname;
+	NameData	relphysname;
 	Oid			reltype;
 	int4		relowner;
 	Oid			relam;
@@ -103,60 +104,62 @@
  *		relacl field.
  * ----------------
  */
-#define Natts_pg_class_fixed			19
-#define Natts_pg_class					20
+#define Natts_pg_class_fixed			20
+#define Natts_pg_class					21
 #define Anum_pg_class_relname			1
-#define Anum_pg_class_reltype			2
-#define Anum_pg_class_relowner			3
-#define Anum_pg_class_relam				4
-#define Anum_pg_class_relpages			5
-#define Anum_pg_class_reltuples			6
-#define Anum_pg_class_rellongrelid		7
-#define Anum_pg_class_relhasindex		8
-#define Anum_pg_class_relisshared		9
-#define Anum_pg_class_relkind			10
-#define Anum_pg_class_relnatts			11
-#define Anum_pg_class_relchecks			12
-#define Anum_pg_class_reltriggers		13
-#define Anum_pg_class_relukeys			14
-#define Anum_pg_class_relfkeys			15
-#define Anum_pg_class_relrefs			16
-#define Anum_pg_class_relhaspkey		17
-#define Anum_pg_class_relhasrules		18
-#define Anum_pg_class_relhassubclass		19
-#define Anum_pg_class_relacl			20
+#define Anum_pg_class_relphysname		2
+#define Anum_pg_class_reltype			3
+#define Anum_pg_class_relowner			4
+#define Anum_pg_class_relam				5
+#define Anum_pg_class_relpages			6
+#define Anum_pg_class_reltuples			7
+#define Anum_pg_class_rellongrelid		8
+#define Anum_pg_class_relhasindex		9
+#define Anum_pg_class_relisshared		10
+#define Anum_pg_class_relkind			11
+#define Anum_pg_class_relnatts			12
+#define Anum_pg_class_relchecks			13
+#define Anum_pg_class_reltriggers		14
+#define Anum_pg_class_relukeys			15
+#define Anum_pg_class_relfkeys			16
+#define Anum_pg_class_relrefs			17
+#define Anum_pg_class_relhaspkey		18
+#define Anum_pg_class_relhasrules		19
+#define Anum_pg_class_relhassubclass	20
+#define Anum_pg_class_relacl			21
 
 /* ----------------
  *		initial contents of pg_class
  * ----------------
  */
 
-DATA(insert OID = 1247 (  pg_type 71		  PGUID 0 0 0 0 f f r 16 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1247 (  pg_type "pg_type_1247" 71		  PGUID 0 0 0 0 f f r 16 0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1249 (  pg_attribute 75	  PGUID 0 0 0 0 f f r 15 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1249 (  pg_attribute "pg_attribute_1249" 75	  PGUID 0 0 0 0 f f r 15 0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1255 (  pg_proc 81		  PGUID 0 0 0 0 f f r 17 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1255 (  pg_proc "pg_proc_1255" 81		  PGUID 0 0 0 0 f f r 17 0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1259 (  pg_class 83		  PGUID 0 0 0 0 f f r 20 0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1259 (  pg_class "pg_class_1259" 83		  PGUID 0 0 0 0 f f r 21 0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1260 (  pg_shadow 86		  PGUID 0 0 0 0 f t r 8  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1260 (  pg_shadow "pg_shadow_1260" 86		  PGUID 0 0 0 0 f t r 8  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1261 (  pg_group 87		  PGUID 0 0 0 0 f t r 3  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1261 (  pg_group "pg_group_1261" 87		  PGUID 0 0 0 0 f t r 3  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1262 (  pg_database 88	  PGUID 0 0 0 0 f t r 4  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1262 (  pg_database "pg_database_1262" 88	  PGUID 0 0 0 0 f t r 4  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1264 (  pg_variable 90	  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1264 (  pg_variable "pg_variable_1264" 90	  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1269 (  pg_log  99		  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1269 (  pg_log "pg_log_1269"  99		  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 376  (  pg_xactlock  0	  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 376  (  pg_xactlock "pg_xactlock_376"  0	  PGUID 0 0 0 0 f t s 1  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1215 (  pg_attrdef 109	  PGUID 0 0 0 0 t t r 4  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1215 (  pg_attrdef "pg_attrdef_1215" 109	  PGUID 0 0 0 0 t t r 4  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1216 (  pg_relcheck 110	  PGUID 0 0 0 0 t t r 4  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1216 (  pg_relcheck "pg_relcheck_1216" 110  PGUID 0 0 0 0 t t r 4  0 0 0 0 0 f f f _null_ ));
 DESCR("");
-DATA(insert OID = 1219 (  pg_trigger 111	  PGUID 0 0 0 0 t t r 13  0 0 0 0 0 f f f _null_ ));
+DATA(insert OID = 1219 (  pg_trigger "pg_trigger_1219" 111	  PGUID 0 0 0 0 t t r 13  0 0 0 0 0 f f f _null_ ));
 DESCR("");
+
 
 #define RelOid_pg_type			1247
 #define RelOid_pg_attribute		1249
Index: include/parser/analyze.h
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/parser/analyze.h,v
retrieving revision 1.10
diff -u -r1.10 analyze.h
--- include/parser/analyze.h	2000/01/26 05:58:26	1.10
+++ include/parser/analyze.h	2000/06/15 22:52:25
@@ -20,4 +20,8 @@
 extern void create_select_list(Node *ptr, List **select_list, bool *unionall_present);
 extern Node *A_Expr_to_Expr(Node *ptr, bool *intersect_present);
 
+/* Routine to make names that are less than NAMEDATALEN long */
+
+extern char *makeObjectName(char *name1, char *name2, char *typename);
+
 #endif	 /* ANALYZE_H */
Index: include/utils/rel.h
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/utils/rel.h,v
retrieving revision 1.36
diff -u -r1.36 rel.h
--- include/utils/rel.h	2000/04/12 17:16:55	1.36
+++ include/utils/rel.h	2000/06/15 22:52:25
@@ -184,22 +184,29 @@
  */
 #define RelationGetRelationName(relation) \
 (\
-	(strncmp(RelationGetPhysicalRelationName(relation), \
+	(strncmp((NameStr((relation)->rd_rel->relname)), \
 	 "pg_temp.", strlen("pg_temp.")) != 0) \
 	? \
-		RelationGetPhysicalRelationName(relation) \
+		(NameStr((relation)->rd_rel->relname)) \
 	: \
 		get_temp_rel_by_physicalname( \
-			RelationGetPhysicalRelationName(relation)) \
+			(NameStr((relation)->rd_rel->relname))) \
 )
 
+/*
+ * RelationGetRealRelationName
+ *
+ *	  Returns a Relation Name
+ */
+#define RelationGetRealRelationName(relation) (NameStr((relation)->rd_rel->relname))
+
 
 /*
  * RelationGetPhysicalRelationName
  *
  *	  Returns a Relation Name
  */
-#define RelationGetPhysicalRelationName(relation) (NameStr((relation)->rd_rel->relname))
+#define RelationGetPhysicalRelationName(relation) (NameStr((relation)->rd_rel->relphysname))
 
 /*
  * RelationGetNumberOfAttributes