Skip to content

Commit d047124

Browse files
committed
Remove 16 char limit on system table/index names. Rename system indexes.
1 parent 80c1e82 commit d047124

File tree

8 files changed

+46
-58
lines changed

8 files changed

+46
-58
lines changed

src/backend/bootstrap/bootstrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.26 1997/09/18 20:20:04 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.27 1997/11/17 16:58:55 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -480,8 +480,8 @@ boot_openrel(char *relname)
480480
HeapScanDesc sdesc;
481481
HeapTuple tup;
482482

483-
if (strlen(relname) > 15)
484-
relname[15] = '\000';
483+
if (strlen(relname) >= NAMEDATALEN-1)
484+
relname[NAMEDATALEN-1] = '\0';
485485

486486
if (Typ == (struct typmap **) NULL)
487487
{

src/backend/commands/view.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.12 1997/09/18 20:20:27 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.13 1997/11/17 16:58:59 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -117,28 +117,16 @@ DefineVirtualRelation(char *relname, List *tlist)
117117
* Given a view name, returns the name for the 'on retrieve to "view"'
118118
* rule.
119119
* This routine is called when defining/removing a view.
120-
*
121-
* NOTE: it quarantees that the name is at most 15 chars long
122-
*
123-
* XXX it also means viewName cannot be 16 chars long! - ay 11/94
124120
*------------------------------------------------------------------
125121
*/
126122
char *
127123
MakeRetrieveViewRuleName(char *viewName)
128124
{
129-
/*
130-
char buf[100];
131-
132-
MemSet(buf, 0, sizeof(buf));
133-
sprintf(buf, "_RET%.*s", NAMEDATALEN, viewName->data);
134-
buf[15] = '\0';
135-
namestrcpy(rule_name, buf);
136-
*/
137-
138125
char *buf;
139126

140127
buf = palloc(strlen(viewName) + 5);
141128
sprintf(buf, "_RET%s", viewName);
129+
142130
return buf;
143131
}
144132

src/backend/parser/parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.26 1997/09/12 04:08:01 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.27 1997/11/17 16:59:08 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -216,7 +216,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
216216
Const *adt;
217217
Datum lcp;
218218
Type tp;
219-
char type_string[16];
219+
char type_string[NAMEDATALEN];
220220
int32 len;
221221
char *cp = NULL;
222222
char *const_string = NULL;

src/backend/utils/cache/inval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.8 1997/09/08 21:48:50 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.9 1997/11/17 16:59:22 momjian Exp $
1111
*
1212
* Note - this code is real crufty...
1313
*
@@ -591,7 +591,7 @@ SetRefreshWhenInvalidate(bool on)
591591
*/
592592
#ifdef INVALIDDEBUG
593593
#define RelationInvalidateHeapTuple_DEBUG1 \
594-
elog(DEBUG, "RelationInvalidateHeapTuple(%.16s, [%d,%d])", \
594+
elog(DEBUG, "RelationInvalidateHeapTuple(%s, [%d,%d])", \
595595
RelationGetRelationName(relation), \
596596
ItemPointerGetBlockNumber(&tuple->t_ctid), \
597597
ItemPointerGetOffsetNumber(&tuple->t_ctid))

src/backend/utils/cache/lsyscache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.6 1997/09/08 21:48:51 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.7 1997/11/17 16:59:23 momjian Exp $
1111
*
1212
* NOTES
1313
* Eventually, the index information should go through here, too.
@@ -148,7 +148,7 @@ get_attisset(Oid relid, char *attname)
148148
PointerGetDatum(attname),
149149
0, 0);
150150
if (!HeapTupleIsValid(htup))
151-
elog(WARN, "get_attisset: no attribute %.16s in relation %d",
151+
elog(WARN, "get_attisset: no attribute %s in relation %d",
152152
attname, relid);
153153
if (heap_attisnull(htup, attno))
154154
return (false);

src/backend/utils/cache/relcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.27 1997/11/02 15:26:06 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.28 1997/11/17 16:59:25 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -366,7 +366,7 @@ scan_pg_rel_seq(RelationBuildDescInfo buildinfo)
366366
case INFO_RELNAME:
367367
ScanKeyEntryInitialize(&key, 0,
368368
Anum_pg_class_relname,
369-
Character16EqualRegProcedure,
369+
NameEqualRegProcedure,
370370
NameGetDatum(buildinfo.i.info_name));
371371
break;
372372

src/include/catalog/indexing.h

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: indexing.h,v 1.11 1997/11/15 20:57:38 momjian Exp $
10+
* $Id: indexing.h,v 1.12 1997/11/17 16:59:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -27,26 +27,26 @@
2727
#define Num_pg_attrdef_indices 1
2828
#define Num_pg_relcheck_indices 1
2929
#define Num_pg_trigger_indices 1
30-
#define Num_pg_objoid_indices 1
30+
#define Num_pg_description_indices 1
3131

3232

3333
/*
3434
* Names of indices on system catalogs
3535
*/
36-
#define AttributeNameIndex "pg_attnameind"
37-
#define AttributeNumIndex "pg_attnumind"
38-
#define AttributeRelidIndex "pg_attrelidind"
39-
#define ProcedureNameIndex "pg_procnameind"
40-
#define ProcedureOidIndex "pg_procidind"
41-
#define ProcedureSrcIndex "pg_procsrcind"
42-
#define TypeNameIndex "pg_typenameind"
43-
#define TypeOidIndex "pg_typeidind"
44-
#define ClassNameIndex "pg_classnameind"
45-
#define ClassOidIndex "pg_classoidind"
46-
#define AttrDefaultIndex "pg_attrdefind"
47-
#define RelCheckIndex "pg_relcheckind"
48-
#define TriggerRelidIndex "pg_trigrelidind"
49-
#define DescriptionObjIndex "pg_descrobjind"
36+
#define AttributeNameIndex "pg_attribute_mkoidname_index"
37+
#define AttributeNumIndex "pg_attribute_mkoidint2_index"
38+
#define AttributeRelidIndex "pg_attribute_attrelid_index"
39+
#define ProcedureOidIndex "pg_proc_oid_index"
40+
#define ProcedureNameIndex "pg_proc_proname_index"
41+
#define ProcedureSrcIndex "pg_proc_prosrc_index"
42+
#define TypeOidIndex "pg_type_oid_index"
43+
#define TypeNameIndex "pg_type_typname_index"
44+
#define ClassOidIndex "pg_class_oid_index"
45+
#define ClassNameIndex "pg_class_relname_index"
46+
#define AttrDefaultIndex "pg_attrdef_adrelid_index"
47+
#define RelCheckIndex "pg_relcheck_rcrelid_index"
48+
#define TriggerRelidIndex "pg_trigger_tgrelid_index"
49+
#define DescriptionObjIndex "pg_description_objoid_index"
5050

5151
extern char *Name_pg_attr_indices[];
5252
extern char *Name_pg_proc_indices[];
@@ -55,7 +55,7 @@ extern char *Name_pg_class_indices[];
5555
extern char *Name_pg_attrdef_indices[];
5656
extern char *Name_pg_relcheck_indices[];
5757
extern char *Name_pg_trigger_indices[];
58-
extern char *Name_pg_objoid_indices[];
58+
extern char *Name_pg_description_indices[];
5959

6060
extern char *IndexedCatalogNames[];
6161

@@ -100,26 +100,27 @@ extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
100100
* The keyword is DECLARE_INDEX every thing after that is just like in a
101101
* normal specification of the 'define index' POSTQUEL command.
102102
*/
103-
DECLARE_INDEX(pg_attnameind on pg_attribute using btree(mkoidname(attrelid, attname) oidname_ops));
104-
DECLARE_INDEX(pg_attnumind on pg_attribute using btree(mkoidint2(attrelid, attnum) oidint2_ops));
105-
DECLARE_INDEX(pg_attrelidind on pg_attribute using btree(attrelid oid_ops));
103+
DECLARE_INDEX(pg_attribute_mkoidname_index on pg_attribute using btree(mkoidname(attrelid, attname) oidname_ops));
104+
DECLARE_INDEX(pg_attribute_mkoidint2_index on pg_attribute using btree(mkoidint2(attrelid, attnum) oidint2_ops));
105+
DECLARE_INDEX(pg_attribute_attrelid_index on pg_attribute using btree(attrelid oid_ops));
106106

107-
DECLARE_INDEX(pg_procidind on pg_proc using btree(Oid oid_ops));
108-
DECLARE_INDEX(pg_procnameind on pg_proc using btree(proname name_ops));
109-
DECLARE_INDEX(pg_procsrcind on pg_proc using btree(prosrc text_ops));
107+
DECLARE_INDEX(pg_proc_oid_index on pg_proc using btree(oid oid_ops));
108+
DECLARE_INDEX(pg_proc_proname_index on pg_proc using btree(proname name_ops));
109+
DECLARE_INDEX(pg_proc_prosrc_index on pg_proc using btree(prosrc text_ops));
110110

111-
DECLARE_INDEX(pg_typeidind on pg_type using btree(Oid oid_ops));
112-
DECLARE_INDEX(pg_typenameind on pg_type using btree(typname name_ops));
111+
DECLARE_INDEX(pg_type_oid_index on pg_type using btree(oid oid_ops));
112+
DECLARE_INDEX(pg_type_typname_index on pg_type using btree(typname name_ops));
113113

114-
DECLARE_INDEX(pg_classnameind on pg_class using btree(relname name_ops));
115-
DECLARE_INDEX(pg_classoidind on pg_class using btree(Oid oid_ops));
114+
DECLARE_INDEX(pg_class_oid_index on pg_class using btree(oid oid_ops));
115+
DECLARE_INDEX(pg_class_relname_index on pg_class using btree(relname name_ops));
116116

117-
DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree(adrelid oid_ops));
118-
DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree(rcrelid oid_ops));
117+
DECLARE_INDEX(pg_attrdef_adrelid_index on pg_attrdef using btree(adrelid oid_ops));
119118

120-
DECLARE_INDEX(pg_trigrelidind on pg_trigger using btree(tgrelid oid_ops));
119+
DECLARE_INDEX(pg_relcheck_rcrelid_index on pg_relcheck using btree(rcrelid oid_ops));
121120

122-
DECLARE_INDEX(pg_descrobjind on pg_description using btree(objoid oid_ops));
121+
DECLARE_INDEX(pg_trigger_tgrelid_index on pg_trigger using btree(tgrelid oid_ops));
122+
123+
DECLARE_INDEX(pg_description_objoid_index on pg_description using btree(objoid oid_ops));
123124

124125
/* now build indices in the initialization scripts */
125126
BUILD_INDICES

src/include/catalog/pg_proc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pg_proc.h,v 1.36 1997/11/15 16:32:09 momjian Exp $
9+
* $Id: pg_proc.h,v 1.37 1997/11/17 16:59:36 momjian Exp $
1010
*
1111
* NOTES
1212
* 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
878878
DESCR("");
879879
DATA(insert OID = 1275 ( char16eq PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar ));
880880
DESCR("");
881-
#define Character16EqualRegProcedure 1275
882881
DATA(insert OID = 1276 ( char16lt PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar ));
883882
DESCR("");
884883
DATA(insert OID = 1277 ( char16le PGUID 11 f t f 2 f 16 "19 19" 100 0 0 100 foo bar ));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy