diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-07 20:16:13 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-07 20:16:13 +0000 |
| commit | 022417740094620880488dd9b04fbb96ff11694b (patch) | |
| tree | fa7a1b0853207355cb1f180d126b939c899825e2 /src/backend/parser | |
| parent | d2165a4a5d7786ecd43becf8e040c5764d35ca16 (diff) | |
| download | postgresql-022417740094620880488dd9b04fbb96ff11694b.tar.gz | |
TOAST mop-up work: update comments for tuple-size-related symbols such
as MaxHeapAttributeNumber. Increase MaxAttrSize to something more
reasonable (given what it's used for, namely checking char(n) declarations,
I didn't make it the full 1G that it could theoretically be --- 10Mb
seemed a more reasonable number). Improve calculation of MaxTupleSize.
Diffstat (limited to 'src/backend/parser')
| -rw-r--r-- | src/backend/parser/gram.y | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 0d2461f50d..2ec136afe8 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.183 2000/08/07 06:54:51 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.184 2000/08/07 20:16:13 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -4153,10 +4153,11 @@ Bit: bit '(' Iconst ')' $$ = makeNode(TypeName); $$->name = $1; if ($3 < 1) - elog(ERROR,"length for type '%s' must be at least 1",$1); - else if ($3 > (MaxAttrSize * sizeof(char))) - elog(ERROR,"length for type '%s' cannot exceed %ld",$1, - (MaxAttrSize * sizeof(char))); + elog(ERROR,"length for type '%s' must be at least 1", + $1); + else if ($3 > (MaxAttrSize * BITSPERBYTE)) + elog(ERROR,"length for type '%s' cannot exceed %d", + $1, (MaxAttrSize * BITSPERBYTE)); $$->typmod = $3; } | bit @@ -4187,10 +4188,11 @@ Character: character '(' Iconst ')' $$ = makeNode(TypeName); $$->name = $1; if ($3 < 1) - elog(ERROR,"length for type '%s' must be at least 1",$1); + elog(ERROR,"length for type '%s' must be at least 1", + $1); else if ($3 > MaxAttrSize) - elog(ERROR,"length for type '%s' cannot exceed %ld",$1, - MaxAttrSize); + elog(ERROR,"length for type '%s' cannot exceed %d", + $1, MaxAttrSize); /* we actually implement these like a varlen, so * the first 4 bytes is the length. (the difference |
