*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.85 1999/07/03 00:32:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.86 1999/07/04 04:55:59 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
if ($3 < 1)
elog(ERROR,"length for '%s' type must be at least 1",$1);
- else if ($3 > MaxTupleSize)
+ else if ($3 > MaxAttrSize)
elog(ERROR,"length for type '%s' cannot exceed %d",$1,
- MaxTupleSize);
+ MaxAttrSize);
/* we actually implement this sort of like a varlen, so
* the first 4 bytes is the length. (the difference
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.47 1999/07/03 00:32:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.48 1999/07/04 04:56:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
else
len = atttypmod - VARHDRSZ;
- if (len > MaxTupleSize)
+ if (len > MaxAttrSize)
elog(ERROR, "bpcharin: length of char() must be less than %d",
- MaxTupleSize);
+ MaxAttrSize);
result = (char *) palloc(atttypmod);
VARSIZE(result) = atttypmod;
rlen = len - VARHDRSZ;
- if (rlen > MaxTupleSize)
+ if (rlen > MaxAttrSize)
elog(ERROR, "bpchar: length of char() must be less than %d",
- MaxTupleSize);
+ MaxAttrSize);
#ifdef STRINGDEBUG
printf("bpchar- convert string length %d (%d) ->%d (%d)\n",
if (atttypmod != -1 && len > atttypmod)
len = atttypmod; /* clip the string at max length */
- if (len > MaxTupleSize)
+ if (len > MaxAttrSize)
elog(ERROR, "varcharin: length of char() must be less than %d",
- MaxTupleSize);
+ MaxAttrSize);
result = (char *) palloc(len);
VARSIZE(result) = len;
len = slen - VARHDRSZ;
#endif
- if (len > MaxTupleSize)
+ if (len > MaxAttrSize)
elog(ERROR, "varchar: length of varchar() must be less than %d",
- MaxTupleSize);
+ MaxAttrSize);
result = (char *) palloc(slen);
VARSIZE(result) = slen;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: htup.h,v 1.18 1999/07/03 01:57:53 momjian Exp $
+ * $Id: htup.h,v 1.19 1999/07/04 04:56:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#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)
sprintf(errortext, "length for '%s' type must be at least 1",$1);
yyerror(errortext);
}
- else if (atol($3) > MaxTupleSize) {
- sprintf(errortext, "length for type '%s' cannot exceed %d",$1,MaxTupleSize);
+ else if (atol($3) > MaxAttrSize) {
+ sprintf(errortext, "length for type '%s' cannot exceed %d",$1,MaxAttrSize);
yyerror(errortext);
}