8On Tue, Aug 16, 2022 at 09:56:17PM -0400, Bruce Momjian wrote:
> On Sun, Nov 14, 2021 at 10:33:19AM +0800, Japin Li wrote:
> > Oh! I didn't consider this situation. Since the max size of varchar cannot
> > exceed 10485760, however, I cannot find this in documentation [1]. Is there
> > something I
On Sun, Nov 14, 2021 at 10:33:19AM +0800, Japin Li wrote:
>
> On Sat, 13 Nov 2021 at 23:42, Tom Lane wrote:
> > Japin Li writes:
> >> postgres=# CREATE TABLE tbl (s varchar(2147483647));
> >> ERROR: length for type varchar cannot exceed 10485760
> >> LINE 1: CREATE TABLE tbl (s varchar(21474836
Tom Lane writes:
> 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
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
[ Please trim quotes appropriately when replying. Nobody wants to
read the whole history of the thread to get to your comment. ]
Japin Li writes:
> Oh! I didn't consider this situation. Since the max size of varchar cannot
> exceed 10485760, however, I cannot find this in documentation [1]. I
On Sat, 13 Nov 2021 at 23:42, Tom Lane wrote:
> Japin Li writes:
>> postgres=# CREATE TABLE tbl (s varchar(2147483647));
>> ERROR: length for type varchar cannot exceed 10485760
>> LINE 1: CREATE TABLE tbl (s varchar(2147483647));
>> ^
>
>> postgres=# CREATE TABLE t
Japin Li writes:
> postgres=# CREATE TABLE tbl (s varchar(2147483647));
> ERROR: length for type varchar cannot exceed 10485760
> LINE 1: CREATE TABLE tbl (s varchar(2147483647));
> ^
> postgres=# CREATE TABLE tbl (s varchar(2147483648));
> ERROR: syntax error at or
Hi, hackers
When I try to create table that has a varchar(n) data type, I find an
inconsistent error message for it.
postgres=# CREATE TABLE tbl (s varchar(2147483647));
ERROR: length for type varchar cannot exceed 10485760
LINE 1: CREATE TABLE tbl (s varchar(2147483647));