OSDN Git Service

Remove 16 char limit on system table/index names. Rename system indexes.
authorBruce Momjian <bruce@momjian.us>
Mon, 17 Nov 1997 16:59:36 +0000 (16:59 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 17 Nov 1997 16:59:36 +0000 (16:59 +0000)
src/backend/bootstrap/bootstrap.c
src/backend/commands/view.c
src/backend/parser/parser.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/relcache.c
src/include/catalog/indexing.h
src/include/catalog/pg_proc.h

index 7ad0c5c..29409a7 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.26 1997/09/18 20:20:04 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.27 1997/11/17 16:58:55 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -480,8 +480,8 @@ boot_openrel(char *relname)
        HeapScanDesc sdesc;
        HeapTuple       tup;
 
-       if (strlen(relname) > 15)
-               relname[15] = '\000';
+       if (strlen(relname) >= NAMEDATALEN-1)
+               relname[NAMEDATALEN-1] = '\0';
 
        if (Typ == (struct typmap **) NULL)
        {
index 1af5a2c..ca4ff5a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.12 1997/09/18 20:20:27 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.13 1997/11/17 16:58:59 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -117,28 +117,16 @@ DefineVirtualRelation(char *relname, List *tlist)
  * Given a view name, returns the name for the 'on retrieve to "view"'
  * rule.
  * This routine is called when defining/removing a view.
- *
- * NOTE: it quarantees that the name is at most 15 chars long
- *
- * XXX it also means viewName cannot be 16 chars long! - ay 11/94
  *------------------------------------------------------------------
  */
 char      *
 MakeRetrieveViewRuleName(char *viewName)
 {
-/*
-       char buf[100];
-
-       MemSet(buf, 0, sizeof(buf));
-       sprintf(buf, "_RET%.*s", NAMEDATALEN, viewName->data);
-       buf[15] = '\0';
-       namestrcpy(rule_name, buf);
-*/
-
        char       *buf;
 
        buf = palloc(strlen(viewName) + 5);
        sprintf(buf, "_RET%s", viewName);
+
        return buf;
 }
 
index 18adb97..a70c90e 100644 (file)
@@ -6,7 +6,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.26 1997/09/12 04:08:01 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.27 1997/11/17 16:59:08 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -216,7 +216,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
        Const      *adt;
        Datum           lcp;
        Type            tp;
-       char            type_string[16];
+       char            type_string[NAMEDATALEN];
        int32           len;
        char       *cp = NULL;
        char       *const_string = NULL;
index b1017fe..e7b4438 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.8 1997/09/08 21:48:50 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.9 1997/11/17 16:59:22 momjian Exp $
  *
  * Note - this code is real crufty...
  *
@@ -591,7 +591,7 @@ SetRefreshWhenInvalidate(bool on)
  */
 #ifdef INVALIDDEBUG
 #define RelationInvalidateHeapTuple_DEBUG1 \
-elog(DEBUG, "RelationInvalidateHeapTuple(%.16s, [%d,%d])", \
+elog(DEBUG, "RelationInvalidateHeapTuple(%s, [%d,%d])", \
         RelationGetRelationName(relation), \
         ItemPointerGetBlockNumber(&tuple->t_ctid), \
         ItemPointerGetOffsetNumber(&tuple->t_ctid))
index 060a7b2..26980c6 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.6 1997/09/08 21:48:51 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.7 1997/11/17 16:59:23 momjian Exp $
  *
  * NOTES
  *       Eventually, the index information should go through here, too.
@@ -148,7 +148,7 @@ get_attisset(Oid relid, char *attname)
                                                           PointerGetDatum(attname),
                                                           0, 0);
        if (!HeapTupleIsValid(htup))
-               elog(WARN, "get_attisset: no attribute %.16s in relation %d",
+               elog(WARN, "get_attisset: no attribute %s in relation %d",
                         attname, relid);
        if (heap_attisnull(htup, attno))
                return (false);
index 90cb42d..046cba3 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.27 1997/11/02 15:26:06 vadim Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.28 1997/11/17 16:59:25 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -366,7 +366,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
                case INFO_RELNAME:
                        ScanKeyEntryInitialize(&key, 0,
                                                                   Anum_pg_class_relname,
-                                                                  Character16EqualRegProcedure,
+                                                                  NameEqualRegProcedure,
                                                                   NameGetDatum(buildinfo.i.info_name));
                        break;
 
index 5adef2d..aeed890 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: indexing.h,v 1.11 1997/11/15 20:57:38 momjian Exp $
+ * $Id: indexing.h,v 1.12 1997/11/17 16:59:34 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
 #define Num_pg_attrdef_indices 1
 #define Num_pg_relcheck_indices 1
 #define Num_pg_trigger_indices 1
-#define Num_pg_objoid_indices  1
+#define Num_pg_description_indices     1
 
 
 /*
  * Names of indices on system catalogs
  */
-#define AttributeNameIndex "pg_attnameind"
-#define AttributeNumIndex  "pg_attnumind"
-#define AttributeRelidIndex "pg_attrelidind"
-#define ProcedureNameIndex "pg_procnameind"
-#define ProcedureOidIndex  "pg_procidind"
-#define ProcedureSrcIndex  "pg_procsrcind"
-#define TypeNameIndex     "pg_typenameind"
-#define TypeOidIndex      "pg_typeidind"
-#define ClassNameIndex    "pg_classnameind"
-#define ClassOidIndex     "pg_classoidind"
-#define AttrDefaultIndex   "pg_attrdefind"
-#define RelCheckIndex     "pg_relcheckind"
-#define TriggerRelidIndex  "pg_trigrelidind"
-#define DescriptionObjIndex "pg_descrobjind"
+#define AttributeNameIndex "pg_attribute_mkoidname_index"
+#define AttributeNumIndex  "pg_attribute_mkoidint2_index"
+#define AttributeRelidIndex "pg_attribute_attrelid_index"
+#define ProcedureOidIndex  "pg_proc_oid_index"
+#define ProcedureNameIndex "pg_proc_proname_index"
+#define ProcedureSrcIndex  "pg_proc_prosrc_index"
+#define TypeOidIndex      "pg_type_oid_index"
+#define TypeNameIndex     "pg_type_typname_index"
+#define ClassOidIndex     "pg_class_oid_index"
+#define ClassNameIndex    "pg_class_relname_index"
+#define AttrDefaultIndex   "pg_attrdef_adrelid_index"
+#define RelCheckIndex     "pg_relcheck_rcrelid_index"
+#define TriggerRelidIndex  "pg_trigger_tgrelid_index"
+#define DescriptionObjIndex "pg_description_objoid_index"
 
 extern char *Name_pg_attr_indices[];
 extern char *Name_pg_proc_indices[];
@@ -55,7 +55,7 @@ extern char *Name_pg_class_indices[];
 extern char *Name_pg_attrdef_indices[];
 extern char *Name_pg_relcheck_indices[];
 extern char *Name_pg_trigger_indices[];
-extern char *Name_pg_objoid_indices[];
+extern char *Name_pg_description_indices[];
 
 extern char *IndexedCatalogNames[];
 
@@ -100,26 +100,27 @@ extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
  * The keyword is DECLARE_INDEX every thing after that is just like in a
  * normal specification of the 'define index' POSTQUEL command.
  */
-DECLARE_INDEX(pg_attnameind on pg_attribute using btree(mkoidname(attrelid, attname) oidname_ops));
-DECLARE_INDEX(pg_attnumind on pg_attribute using btree(mkoidint2(attrelid, attnum) oidint2_ops));
-DECLARE_INDEX(pg_attrelidind on pg_attribute using btree(attrelid oid_ops));
+DECLARE_INDEX(pg_attribute_mkoidname_index on pg_attribute using btree(mkoidname(attrelid, attname) oidname_ops));
+DECLARE_INDEX(pg_attribute_mkoidint2_index on pg_attribute using btree(mkoidint2(attrelid, attnum) oidint2_ops));
+DECLARE_INDEX(pg_attribute_attrelid_index on pg_attribute using btree(attrelid oid_ops));
 
-DECLARE_INDEX(pg_procidind on pg_proc using btree(Oid oid_ops));
-DECLARE_INDEX(pg_procnameind on pg_proc using btree(proname name_ops));
-DECLARE_INDEX(pg_procsrcind on pg_proc using btree(prosrc text_ops));
+DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops));
+DECLARE_INDEX(pg_proc_proname_index on pg_proc using btree(proname name_ops));
+DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops));
 
-DECLARE_INDEX(pg_typeidind on pg_type using btree(Oid oid_ops));
-DECLARE_INDEX(pg_typenameind on pg_type using btree(typname name_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_classnameind on pg_class using btree(relname name_ops));
-DECLARE_INDEX(pg_classoidind on pg_class using btree(Oid oid_ops));
+DECLARE_INDEX(pg_class_oid_index on pg_class using btree(oid oid_ops));
+DECLARE_INDEX(pg_class_relname_index on pg_class using btree(relname name_ops));
 
-DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree(adrelid oid_ops));
-DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree(rcrelid oid_ops));
+DECLARE_INDEX(pg_attrdef_adrelid_index on pg_attrdef using btree(adrelid oid_ops));
 
-DECLARE_INDEX(pg_trigrelidind on pg_trigger using btree(tgrelid oid_ops));
+DECLARE_INDEX(pg_relcheck_rcrelid_index on pg_relcheck using btree(rcrelid oid_ops));
 
-DECLARE_INDEX(pg_descrobjind on pg_description using btree(objoid oid_ops));
+DECLARE_INDEX(pg_trigger_tgrelid_index on pg_trigger using btree(tgrelid oid_ops));
+
+DECLARE_INDEX(pg_description_objoid_index on pg_description using btree(objoid oid_ops));
 
 /* now build indices in the initialization scripts */
 BUILD_INDICES
index 944b2a4..6bfc903 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_proc.h,v 1.36 1997/11/15 16:32:09 momjian Exp $
+ * $Id: pg_proc.h,v 1.37 1997/11/17 16:59:36 momjian Exp $
  *
  * NOTES
  *       The script catalog/genbki.sh reads this file and generates .bki
@@ -878,7 +878,6 @@ DATA(insert OID = 484 (  char2ge               PGUID 11 f t f 2 f 16 "409 409" 100 0 0 100
 DESCR("");
 DATA(insert OID = 1275 (  char16eq                PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100  foo bar ));
 DESCR("");
-#define Character16EqualRegProcedure   1275
 DATA(insert OID = 1276 (  char16lt                PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100  foo bar ));
 DESCR("");
 DATA(insert OID = 1277 (  char16le                PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100  foo bar ));