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

Commit46bb23a

Browse files
committed
Change NAMEDATALEN to 64, INDEX_MAX_KEYS/MAX_FUNC_ARGS to 32, per discussion on hackers.
1 parentf8b4a2e commit46bb23a

File tree

19 files changed

+93
-91
lines changed

19 files changed

+93
-91
lines changed

‎doc/FAQ_DEV

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@
560560
Table, column, type, function, and view names are stored in system
561561
tables in columns of type Name. Name is a fixed-length,
562562
null-terminated type of NAMEDATALEN bytes. (The default value for
563-
NAMEDATALEN is32 bytes.)
563+
NAMEDATALEN is64 bytes.)
564564
typedef struct nameData
565565
{
566566
char data[NAMEDATALEN];

‎doc/src/sgml/datatype.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.97 2002/08/05 19:43:30 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.98 2002/08/13 20:40:43 momjian Exp $
33
-->
44

55
<chapter id="datatype">
@@ -914,7 +914,7 @@ SELECT b, char_length(b) FROM test2;
914914
<productname>PostgreSQL</productname>. The <type>name</type> type
915915
exists <emphasis>only</emphasis> for storage of internal catalog
916916
names and is not intended for use by the general user. Its length
917-
is currently defined as32 bytes (31 usable characters plus terminator)
917+
is currently defined as64 bytes (63 usable characters plus terminator)
918918
but should be referenced using the macro
919919
<symbol>NAMEDATALEN</symbol>. The length is set at compile time
920920
(and is therefore adjustable for special uses); the default
@@ -943,8 +943,8 @@ SELECT b, char_length(b) FROM test2;
943943
</row>
944944
<row>
945945
<entry>name</entry>
946-
<entry>32 bytes</entry>
947-
<entry>Thirty-one character internal type</entry>
946+
<entry>64 bytes</entry>
947+
<entry>Sixty-three character internal type</entry>
948948
</row>
949949
</tbody>
950950
</tgroup>

‎doc/src/sgml/indices.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.35 2002/07/30 17:34:37 tgl Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.36 2002/08/13 20:40:43 momjian Exp $ -->
22

33
<chapter id="indexes">
44
<title id="indexes-title">Indexes</title>
@@ -236,7 +236,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor);
236236

237237
<para>
238238
Currently, only the B-tree and GiST implementations support multicolumn
239-
indexes. Up to16 columns may be specified. (This limit can be
239+
indexes. Up to32 columns may be specified. (This limit can be
240240
altered when building <productname>PostgreSQL</productname>; see the
241241
file <filename>pg_config.h</filename>.)
242242
</para>

‎doc/src/sgml/manage.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/manage.sgml,v 1.22 2002/08/10 19:35:00 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/manage.sgml,v 1.23 2002/08/13 20:40:43 momjian Exp $
33
-->
44

55
<Chapter Id="manage">
@@ -70,7 +70,7 @@ ERROR: CREATE DATABASE: Permission denied.
7070
You automatically become the
7171
database administrator of the database you just created.
7272
Database names must have an alphabetic first
73-
character and are limited to31 characters in length.
73+
character and are limited to63 characters in length.
7474
<ProductName>PostgreSQL</ProductName> allows you to create any number of
7575
databases at a given site.
7676
</Para>

‎doc/src/sgml/ref/create_index.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.35 2002/07/30 17:34:37 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.36 2002/08/13 20:40:43 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -339,7 +339,7 @@ ERROR: Cannot create index: 'index_name' already exists.
339339

340340
<para>
341341
Currently, only the B-tree and gist access methods support multicolumn
342-
indexes. Up to16 keys may be specified by default (this limit
342+
indexes. Up to32 keys may be specified by default (this limit
343343
can be altered when building
344344
<application>PostgreSQL</application>). Only B-tree currently supports
345345
unique indexes.

‎doc/src/sgml/ref/current_user.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/current_user.sgml,v 1.6 2002/04/21 19:02:39 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/current_user.sgml,v 1.7 2002/08/13 20:40:43 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -77,7 +77,7 @@ The name of the current user.
7777
Notes
7878
</TITLE>
7979
<PARA>
80-
Data type "name" is a non-standard31-character type for storing
80+
Data type "name" is a non-standard63-character type for storing
8181
system identifiers.
8282
</PARA>
8383
</REFSECT2>

‎doc/src/sgml/ref/listen.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/listen.sgml,v 1.13 2002/04/21 19:02:39 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/listen.sgml,v 1.14 2002/08/13 20:40:43 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -146,7 +146,7 @@ WARNING: Async_Listen: We are already listening on <replaceable class="PARAMETE
146146
it need not correspond to the name of any actual table. If
147147
<replaceable class="PARAMETER">notifyname</replaceable>
148148
is enclosed in double-quotes, it need not even be a syntactically
149-
valid name, but can be any string up to31 characters long.
149+
valid name, but can be any string up to63 characters long.
150150
</para>
151151
<para>
152152
In some previous releases of

‎doc/src/sgml/ref/notify.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/notify.sgml,v 1.17 2002/04/21 19:02:39 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/notify.sgml,v 1.18 2002/08/13 20:40:44 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -180,7 +180,7 @@ NOTIFY
180180
it need not correspond to the name of any actual table. If
181181
<replaceable class="PARAMETER">name</replaceable>
182182
is enclosed in double-quotes, it need not even be a syntactically
183-
valid name, but can be any string up to31 characters long.
183+
valid name, but can be any string up to63 characters long.
184184
</para>
185185
<para>
186186
In some previous releases of

‎doc/src/sgml/ref/unlisten.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/unlisten.sgml,v 1.18 2002/04/21 19:02:39 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/unlisten.sgml,v 1.19 2002/08/13 20:40:44 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -114,7 +114,7 @@ UNLISTEN { <replaceable class="PARAMETER">notifyname</replaceable> | * }
114114
<para>
115115
<replaceable class="PARAMETER">notifyname</replaceable>
116116
need not be a valid class name but can be any string valid
117-
as a name up to32 characters long.
117+
as a name up to64 characters long.
118118
</para>
119119
<para>
120120
The backend does not complain if you UNLISTEN something you were not

‎doc/src/sgml/start.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.23 2002/08/10 19:35:00 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/start.sgml,v 1.24 2002/08/13 20:40:43 momjian Exp $
33
-->
44

55
<chapter id="tutorial-start">
@@ -231,7 +231,7 @@ createdb: database creation failed
231231
You can also create databases with other names.
232232
<productname>PostgreSQL</productname> allows you to create any
233233
number of databases at a given site. Database names must have an
234-
alphabetic first character and are limited to31 characters in
234+
alphabetic first character and are limited to63 characters in
235235
length. A convenient choice is to create a database with the same
236236
name as your current user name. Many tools assume that database
237237
name as the default, so it can save you some typing. To create

‎doc/src/sgml/syntax.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.65 2002/08/10 19:01:53 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.66 2002/08/13 20:40:43 momjian Exp $
33
-->
44

55
<chapter id="sql-syntax">
@@ -120,8 +120,8 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there');
120120
The system uses no more than <symbol>NAMEDATALEN</symbol>-1
121121
characters of an identifier; longer names can be written in
122122
commands, but they will be truncated. By default,
123-
<symbol>NAMEDATALEN</symbol> is32 so the maximum identifier length
124-
is31 (but at the time the system is built,
123+
<symbol>NAMEDATALEN</symbol> is64 so the maximum identifier length
124+
is63 (but at the time the system is built,
125125
<symbol>NAMEDATALEN</symbol> can be changed in
126126
<filename>src/include/postgres_ext.h</filename>).
127127
</para>

‎src/bin/psql/command.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000-2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.75 2002/08/10 03:56:23 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.76 2002/08/13 20:40:44 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -1513,7 +1513,7 @@ editFile(const char *fname)
15131513
sys=malloc(strlen(editorName)+strlen(fname)+32+1);
15141514
if (!sys)
15151515
return false;
1516-
sprintf(sys,"exec %s %s",editorName,fname);
1516+
snprintf(sys,32,"exec %s %s",editorName,fname);
15171517
result=system(sys);
15181518
if (result==-1)
15191519
psql_error("could not start editor %s\n",editorName);

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $Id: catversion.h,v 1.147 2002/08/09 16:45:14 tgl Exp $
40+
* $Id: catversion.h,v 1.148 2002/08/13 20:40:44 momjian Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200208091
56+
#defineCATALOG_VERSION_NO200208131
5757

5858
#endif

‎src/include/pg_config.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: pg_config.h.in,v 1.26 2002/07/31 17:19:54 tgl Exp $
11+
* $Id: pg_config.h.in,v 1.27 2002/08/13 20:40:44 momjian Exp $
1212
*/
1313

1414
#ifndefPG_CONFIG_H
@@ -162,7 +162,7 @@
162162
* switch statement in fmgr_oldstyle() in src/backend/utils/fmgr/fmgr.c.
163163
* But consider converting such functions to new-style instead...
164164
*/
165-
#defineINDEX_MAX_KEYS16
165+
#defineINDEX_MAX_KEYS32
166166
#defineFUNC_MAX_ARGSINDEX_MAX_KEYS
167167

168168
/*

‎src/include/postgres_ext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*use header files that are otherwise internal to Postgres to interface
1616
*with the backend.
1717
*
18-
* $Id: postgres_ext.h,v 1.10 2002/04/30 19:53:03 tgl Exp $
18+
* $Id: postgres_ext.h,v 1.11 2002/08/13 20:40:44 momjian Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -41,6 +41,6 @@ typedef unsigned int Oid;
4141
*
4242
* NOTE that databases with different NAMEDATALEN's cannot interoperate!
4343
*/
44-
#defineNAMEDATALEN32
44+
#defineNAMEDATALEN64
4545

4646
#endif

‎src/interfaces/jdbc/org/postgresql/errors.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ postgresql.res.colname:The column name {0} not found.
6161
postgresql.res.colrange:The column index is out of range.
6262
postgresql.res.nextrequired:Result set not positioned properly, perhaps you need to call next().
6363
postgresql.serial.interface:You cannot serialize an interface.
64-
postgresql.serial.namelength:Class & Package name length cannot be longer than32 characters. {0} is {1} characters.
64+
postgresql.serial.namelength:Class & Package name length cannot be longer than64 characters. {0} is {1} characters.
6565
postgresql.serial.noclass:No class found for {0}
6666
postgresql.serial.table:The table for {0} is not in the database. Contact the DBA, as the database is in an inconsistent state.
6767
postgresql.serial.underscore:Class names may not have _ in them. You supplied {0}.

‎src/interfaces/jdbc/org/postgresql/util/Serialize.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* There are a number of limitations placed on the java class to be
5858
* used by Serialize:
5959
* <ul>
60-
* <li>The class name must be less than32 chars long and must be all lowercase.
60+
* <li>The class name must be less than64 chars long and must be all lowercase.
6161
* This is due to limitations in Postgres about the size of table names.
6262
* The name must be all lowercase since table names in Postgres are
6363
* case insensitive and the relname is stored in lowercase. Unless some
@@ -577,7 +577,7 @@ public static void create(Connection con, Class c) throws SQLException
577577
*
578578
* Because of this, a Class name may not have _ in the name.<p>
579579
* Another limitation, is that the entire class name (including packages)
580-
* cannot be longer than32 characters (a limit forced by PostgreSQL).
580+
* cannot be longer than64 characters (a limit forced by PostgreSQL).
581581
*
582582
* @param name Class name
583583
* @return PostgreSQL table name
@@ -590,16 +590,16 @@ public static String toPostgreSQL(String name) throws SQLException
590590
if (name.indexOf("_") > -1)
591591
thrownewPSQLException("postgresql.serial.underscore");
592592

593-
// Postgres table names can only be32 character long.
594-
// Reserve 1 char, so allow only up to31 chars.
593+
// Postgres table names can only be64 character long.
594+
// Reserve 1 char, so allow only up to63 chars.
595595
// If the full class name with package is too long
596596
// then just use the class name. If the class name is
597597
// too long throw an exception.
598598
//
599-
if (name.length() >31 )
599+
if (name.length() >63 )
600600
{
601601
name =name.substring(name.lastIndexOf(".") +1);
602-
if (name.length() >31 )
602+
if (name.length() >63 )
603603
thrownewPSQLException("postgresql.serial.namelength",name,newInteger(name.length()));
604604
}
605605
returnname.replace('.','_');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp