[BUGS] BUG #14497: 1G bytea insert error - Mailing list pgsql-bugs

From nikolay.nikitin@infowatch.com
Subject [BUGS] BUG #14497: 1G bytea insert error
Date
Msg-id 20170116125751.1432.67469@wrigleys.postgresql.org
Whole thread Raw
List 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 by date:

Previous
From: zszabo@chemaxon.com
Date:
Subject: [BUGS] BUG #14496: Cost of comparator is not taken into account in sorting
Next
From: liomry@gmail.com
Date:
Subject: [BUGS] BUG #14498: Default role should be case sensitive when created inWindows