Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
eba41848
Commit
eba41848
authored
Jul 04, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify maximum tuple and max attribute lengths.
parent
b31aa64f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
src/backend/parser/gram.y
src/backend/parser/gram.y
+3
-3
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+9
-9
src/include/access/htup.h
src/include/access/htup.h
+4
-2
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+2
-2
No files found.
src/backend/parser/gram.y
View file @
eba41848
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.8
5 1999/07/03 00:32:44
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.8
6 1999/07/04 04:55:59
momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -3385,9 +3385,9 @@ Character: character '(' Iconst ')'
if ($3 < 1)
elog(ERROR,"length for '%s' type must be at least 1",$1);
else if ($3 > Max
Tuple
Size)
else if ($3 > Max
Attr
Size)
elog(ERROR,"length for type '%s' cannot exceed %d",$1,
Max
Tuple
Size);
Max
Attr
Size);
/* we actually implement this sort of like a varlen, so
* the first 4 bytes is the length. (the difference
...
...
src/backend/utils/adt/varchar.c
View file @
eba41848
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
7 1999/07/03 00:32:5
0 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.4
8 1999/07/04 04:56:0
0 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -82,9 +82,9 @@ bpcharin(char *s, int dummy, int32 atttypmod)
else
len
=
atttypmod
-
VARHDRSZ
;
if
(
len
>
Max
Tuple
Size
)
if
(
len
>
Max
Attr
Size
)
elog
(
ERROR
,
"bpcharin: length of char() must be less than %d"
,
Max
Tuple
Size
);
Max
Attr
Size
);
result
=
(
char
*
)
palloc
(
atttypmod
);
VARSIZE
(
result
)
=
atttypmod
;
...
...
@@ -153,9 +153,9 @@ bpchar(char *s, int32 len)
rlen
=
len
-
VARHDRSZ
;
if
(
rlen
>
Max
Tuple
Size
)
if
(
rlen
>
Max
Attr
Size
)
elog
(
ERROR
,
"bpchar: length of char() must be less than %d"
,
Max
Tuple
Size
);
Max
Attr
Size
);
#ifdef STRINGDEBUG
printf
(
"bpchar- convert string length %d (%d) ->%d (%d)
\n
"
,
...
...
@@ -335,9 +335,9 @@ varcharin(char *s, int dummy, int32 atttypmod)
if
(
atttypmod
!=
-
1
&&
len
>
atttypmod
)
len
=
atttypmod
;
/* clip the string at max length */
if
(
len
>
Max
Tuple
Size
)
if
(
len
>
Max
Attr
Size
)
elog
(
ERROR
,
"varcharin: length of char() must be less than %d"
,
Max
Tuple
Size
);
Max
Attr
Size
);
result
=
(
char
*
)
palloc
(
len
);
VARSIZE
(
result
)
=
len
;
...
...
@@ -407,9 +407,9 @@ varchar(char *s, int32 slen)
len
=
slen
-
VARHDRSZ
;
#endif
if
(
len
>
Max
Tuple
Size
)
if
(
len
>
Max
Attr
Size
)
elog
(
ERROR
,
"varchar: length of varchar() must be less than %d"
,
Max
Tuple
Size
);
Max
Attr
Size
);
result
=
(
char
*
)
palloc
(
slen
);
VARSIZE
(
result
)
=
slen
;
...
...
src/include/access/htup.h
View file @
eba41848
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: htup.h,v 1.1
8 1999/07/03 01:57:53
momjian Exp $
* $Id: htup.h,v 1.1
9 1999/07/04 04:56:01
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -56,7 +56,9 @@ typedef HeapTupleHeaderData *HeapTupleHeader;
#define MinTupleSize (DOUBLEALIGN(sizeof (PageHeaderData) + \
sizeof(HeapTupleHeaderData) + sizeof(int4)))
#define MaxTupleSize (BLCKSZ/2 - MinTupleSize)
#define MaxTupleSize (BLCKSZ - MinTupleSize)
#define MaxAttrSize (MaxTupleSize - sizeof(HeapTupleHeaderData))
#define SelfItemPointerAttributeNumber (-1)
#define ObjectIdAttributeNumber (-2)
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
eba41848
...
...
@@ -3354,8 +3354,8 @@ Character: character '(' Iconst ')'
sprintf(errortext, "length for '%s' type must be at least 1",$1);
yyerror(errortext);
}
else if (atol($3) > Max
Tuple
Size) {
sprintf(errortext, "length for type '%s' cannot exceed %d",$1,Max
Tuple
Size);
else if (atol($3) > Max
Attr
Size) {
sprintf(errortext, "length for type '%s' cannot exceed %d",$1,Max
Attr
Size);
yyerror(errortext);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment