Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd047124

Browse files
committed
Remove 16 char limit on system table/index names. Rename system indexes.
1 parent80c1e82 commitd047124

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
HeapScanDescsdesc;
481481
HeapTupletup;
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== (structtypmap**)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
returnbuf;
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
Datumlcp;
218218
Typetp;
219-
chartype_string[16];
219+
chartype_string[NAMEDATALEN];
220220
int32len;
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
#ifdefINVALIDDEBUG
593593
#defineRelationInvalidateHeapTuple_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
caseINFO_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
#defineNum_pg_attrdef_indices1
2828
#defineNum_pg_relcheck_indices 1
2929
#defineNum_pg_trigger_indices1
30-
#defineNum_pg_objoid_indices1
30+
#defineNum_pg_description_indices1
3131

3232

3333
/*
3434
* Names of indices on system catalogs
3535
*/
36-
#defineAttributeNameIndex "pg_attnameind"
37-
#defineAttributeNumIndex "pg_attnumind"
38-
#defineAttributeRelidIndex "pg_attrelidind"
39-
#defineProcedureNameIndex "pg_procnameind"
40-
#defineProcedureOidIndex "pg_procidind"
41-
#defineProcedureSrcIndex "pg_procsrcind"
42-
#defineTypeNameIndex "pg_typenameind"
43-
#defineTypeOidIndex "pg_typeidind"
44-
#defineClassNameIndex "pg_classnameind"
45-
#defineClassOidIndex "pg_classoidind"
46-
#defineAttrDefaultIndex "pg_attrdefind"
47-
#defineRelCheckIndex "pg_relcheckind"
48-
#defineTriggerRelidIndex "pg_trigrelidind"
49-
#defineDescriptionObjIndex "pg_descrobjind"
36+
#defineAttributeNameIndex "pg_attribute_mkoidname_index"
37+
#defineAttributeNumIndex "pg_attribute_mkoidint2_index"
38+
#defineAttributeRelidIndex "pg_attribute_attrelid_index"
39+
#defineProcedureOidIndex "pg_proc_oid_index"
40+
#defineProcedureNameIndex "pg_proc_proname_index"
41+
#defineProcedureSrcIndex "pg_proc_prosrc_index"
42+
#defineTypeOidIndex "pg_type_oid_index"
43+
#defineTypeNameIndex "pg_type_typname_index"
44+
#defineClassOidIndex "pg_class_oid_index"
45+
#defineClassNameIndex "pg_class_relname_index"
46+
#defineAttrDefaultIndex "pg_attrdef_adrelid_index"
47+
#defineRelCheckIndex "pg_relcheck_rcrelid_index"
48+
#defineTriggerRelidIndex "pg_trigger_tgrelid_index"
49+
#defineDescriptionObjIndex "pg_description_objoid_index"
5050

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

6060
externchar*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_attnameindonpg_attributeusingbtree(mkoidname(attrelid,attname)oidname_ops));
104-
DECLARE_INDEX(pg_attnumindonpg_attributeusingbtree(mkoidint2(attrelid,attnum)oidint2_ops));
105-
DECLARE_INDEX(pg_attrelidindonpg_attributeusingbtree(attrelidoid_ops));
103+
DECLARE_INDEX(pg_attribute_mkoidname_indexonpg_attributeusingbtree(mkoidname(attrelid,attname)oidname_ops));
104+
DECLARE_INDEX(pg_attribute_mkoidint2_indexonpg_attributeusingbtree(mkoidint2(attrelid,attnum)oidint2_ops));
105+
DECLARE_INDEX(pg_attribute_attrelid_indexonpg_attributeusingbtree(attrelidoid_ops));
106106

107-
DECLARE_INDEX(pg_procidindonpg_procusingbtree(Oidoid_ops));
108-
DECLARE_INDEX(pg_procnameindonpg_procusingbtree(pronamename_ops));
109-
DECLARE_INDEX(pg_procsrcindonpg_procusingbtree(prosrctext_ops));
107+
DECLARE_INDEX(pg_proc_oid_indexonpg_procusingbtree(oidoid_ops));
108+
DECLARE_INDEX(pg_proc_proname_indexonpg_procusingbtree(pronamename_ops));
109+
DECLARE_INDEX(pg_proc_prosrc_indexonpg_procusingbtree(prosrctext_ops));
110110

111-
DECLARE_INDEX(pg_typeidindonpg_typeusingbtree(Oidoid_ops));
112-
DECLARE_INDEX(pg_typenameindonpg_typeusingbtree(typnamename_ops));
111+
DECLARE_INDEX(pg_type_oid_indexonpg_typeusingbtree(oidoid_ops));
112+
DECLARE_INDEX(pg_type_typname_indexonpg_typeusingbtree(typnamename_ops));
113113

114-
DECLARE_INDEX(pg_classnameindonpg_classusingbtree(relnamename_ops));
115-
DECLARE_INDEX(pg_classoidindonpg_classusingbtree(Oidoid_ops));
114+
DECLARE_INDEX(pg_class_oid_indexonpg_classusingbtree(oidoid_ops));
115+
DECLARE_INDEX(pg_class_relname_indexonpg_classusingbtree(relnamename_ops));
116116

117-
DECLARE_INDEX(pg_attrdefindonpg_attrdefusingbtree(adrelidoid_ops));
118-
DECLARE_INDEX(pg_relcheckindonpg_relcheckusingbtree(rcrelidoid_ops));
117+
DECLARE_INDEX(pg_attrdef_adrelid_indexonpg_attrdefusingbtree(adrelidoid_ops));
119118

120-
DECLARE_INDEX(pg_trigrelidindonpg_triggerusingbtree(tgrelidoid_ops));
119+
DECLARE_INDEX(pg_relcheck_rcrelid_indexonpg_relcheckusingbtree(rcrelidoid_ops));
121120

122-
DECLARE_INDEX(pg_descrobjindonpg_descriptionusingbtree(objoidoid_ops));
121+
DECLARE_INDEX(pg_trigger_tgrelid_indexonpg_triggerusingbtree(tgrelidoid_ops));
122+
123+
DECLARE_INDEX(pg_description_objoid_indexonpg_descriptionusingbtree(objoidoid_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(insertOID=1275 (char16eqPGUID11ftf2f16"19 19"10000100foobar ));
880880
DESCR("");
881-
#defineCharacter16EqualRegProcedure1275
882881
DATA(insertOID=1276 (char16ltPGUID11ftf2f16"19 19"10000100foobar ));
883882
DESCR("");
884883
DATA(insertOID=1277 (char16lePGUID11ftf2f16"19 19"10000100foobar ));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp