Re: Inconsistent error message for varchar(n)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inconsistent error message for varchar(n)
Дата
Msg-id 2017821.1636917090@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Inconsistent error message for varchar(n)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Inconsistent error message for varchar(n)  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Список pgsql-hackers
I wrote:
> For comparison, it doesn't bring up the point that string values are
> constrained to 1GB; that's dealt with elsewhere.  Since the limit on
> typmod is substantially more than that, I'm not sure there's much point
> in mentioning it specifically.

Oh, wait, I was not counting the zeroes in that number :-(

Tracking it a bit further, the actual typmod limit is set by this:

/*
 * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of
 * data fields of char(n) and similar types.  It need not have anything
 * directly to do with the *actual* upper limit of varlena values, which
 * is currently 1Gb (see TOAST structures in postgres.h).  I've set it
 * at 10Mb which seems like a reasonable number --- tgl 8/6/00.
 */
#define MaxAttrSize        (10 * 1024 * 1024)

So maybe that's something we *should* document, though we'd have to
explain that the limit on text and unconstrained varchar is different.

            regards, tom lane

(From the writing style, I suspect the "tgl" here is me not Tom Lockhart.
I'm too lazy to dig in the git history to confirm it though.)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Inconsistent error message for varchar(n)
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Commitfest 2021-11 Patch Triage - Part 2