document json[b] limitation
document json[b] limitation
Hi there, Attached is a small patch, which documents the maximum size of json[b] types. Probably, it's worth to patch previous releases, where the types were introduced. Best regards, Oleg -- Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Re: document json[b] limitation
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Oleg Bartunov writes: > Attached is a small patch, which documents the maximum size of > json[b] types. Probably, it's worth to patch previous releases, where > the types were introduced. If you said "maximum size is 1GB", period, I'd believe it ... although I'm pretty sure that general limitation is already documented elsewhere. I don't believe that it's possible to make a 256 Gb jsonb. How will that fit in the varlena header? regards, tom lane
Re: document json[b] limitation
От:
Oleg Bartunov <obartunov@postgrespro.ru>
Дата:
On Wed, Apr 25, 2018 at 2:12 AM, Tom Lane wrote: > Oleg Bartunov writes: >> Attached is a small patch, which documents the maximum size of >> json[b] types. Probably, it's worth to patch previous releases, where >> the types were introduced. > > If you said "maximum size is 1GB", period, I'd believe it ... although > I'm pretty sure that general limitation is already documented elsewhere. > I don't believe that it's possible to make a 256 Gb jsonb. How will > that fit in the varlena header? Oops, it should be 256 Mb :) > > regards, tom lane > -- Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Re: document json[b] limitation
On Wed, Apr 25, 2018 at 6:50 PM, Oleg Bartunov wrote: > On Wed, Apr 25, 2018 at 2:12 AM, Tom Lane wrote: >> Oleg Bartunov writes: >>> Attached is a small patch, which documents the maximum size of >>> json[b] types. Probably, it's worth to patch previous releases, where >>> the types were introduced. >> >> If you said "maximum size is 1GB", period, I'd believe it ... although >> I'm pretty sure that general limitation is already documented elsewhere. >> I don't believe that it's possible to make a 256 Gb jsonb. How will >> that fit in the varlena header? > > Oops, it should be 256 Mb :) patch attached. > >> >> regards, tom lane >> > > > > -- > Postgres Professional: http://www.postgrespro.com > The Russian Postgres Company -- Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Re: document json[b] limitation
On Wed, Apr 25, 2018 at 06:50:51PM +0300, Oleg Bartunov wrote:
> Oops, it should be 256 Mb :)
The numbers you are presenting are right, aka 1GB for json:
=# create table aa (a json);
CREATE TABLE
=# insert into aa select ('{"key":"' || repeat('a', 512 * 1024 * 1024) ||
repeat('a', 500 * 1024 * 1024) || '"}')::json;
INSERT 0 1
=# insert into aa select ('{"key":"' || repeat('a', 512 * 1024 *
1024) || repeat('a', 512 * 1024 * 1024) || '"}')::json;
ERROR: XX000: invalid memory alloc request size 1073741836
LOCATION: palloc, mcxt.c:934
And 256MB for jsonb:
=# create table ab (a jsonb);
CREATE TABLE
=# insert into aa select ('{"key":"' || repeat('a', 256 * 1024 *
1024) || '"}')::jsonb;
ERROR: 54000: string too long to represent as jsonb string
DETAIL: Due to an implementation restriction, jsonb strings cannot
exceed 268435455 bytes.
Be sure to use an upper-case "B" to mean bytes and not bits in the
documentation.
--
Michael