[BUGS] BUG #14497: 1G bytea insert error

Поиск
Список
Период
Сортировка
От nikolay.nikitin@infowatch.com
Тема [BUGS] BUG #14497: 1G bytea insert error
Дата
Msg-id 20170116125751.1432.67469@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14497
Logged by:          Nikolay Nikitin
Email address:      nikolay.nikitin@infowatch.com
PostgreSQL version: 9.4.10
Operating system:   Red Hat Enterprise Linux Server release 6.7
Description:

Hi! I try to insert 1G bytea value into the simple table and get the
error.

drop table if exists test;

create table test 
(
  blob bytea
);

insert into test(blob) select string_agg(gen_random_bytes(1024 - case when g
= 1024 then 52 else 0 end), null::bytea)::bytea from generate_series(1, 1024
* 1024) g;

ERROR:  invalid memory alloc request size 1073741824
********** Ошибка **********

ERROR: invalid memory alloc request size 1073741824
SQL-состояние: XX000


Value equal or greater 1G-52 raises the error. But smaller value inserts
without errors.


insert into test(blob) select string_agg(gen_random_bytes(1024 - case when g
= 1024 then 53 else 0 end), null::bytea)::bytea from generate_series(1, 1024
* 1024) g;
Query returned successfully: one row affected, 02:04 minutes execution
time.

I think 1G has to be inserted without errors.

Regards, Nikolay.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: zszabo@chemaxon.com
Дата:
Сообщение: [BUGS] BUG #14496: Cost of comparator is not taken into account in sorting
Следующее
От: liomry@gmail.com
Дата:
Сообщение: [BUGS] BUG #14498: Default role should be case sensitive when created inWindows