Re: document json[b] limitation

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: document json[b] limitation
Дата
Msg-id 20180426015910.GC18940@paquier.xyz
обсуждение исходный текст
Ответ на Re: document json[b] limitation  (Oleg Bartunov <obartunov@postgrespro.ru>)
Список pgsql-docs
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

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: how does jsonb_set work?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Pgadmin III is officially not supported