[HACKERS] [bug-fix] Cannot select big bytea values (~600MB)

Поиск
Список
Период
Сортировка
От Anna Akenteva
Тема [HACKERS] [bug-fix] Cannot select big bytea values (~600MB)
Дата
Msg-id c8bdf802d41ec37003ec3b726db79428@postgrespro.ru
обсуждение исходный текст
Ответы Re: [HACKERS] [bug-fix] Cannot select big bytea values (~600MB)
Список pgsql-hackers
Hello!

If I create a big bytea value and try to select it from a table, I get 
an error, something like: "ERROR:  invalid memory alloc request size 
...".

So basically we can insert data into a table but then we can't even work 
with it. Sounds like a bug. Attaching a patch that fixes it (applies to 
2a41507dab0f293ff241fe8ae326065998668af8).

And as it seems like quite a serious issue, would it be possible to 
backport a fix for it to earlier versions?




HOW TO RECREATE:
1) generate some random data (in this case, 600 MB):
dd if=/dev/urandom of=rand.dat bs=1M count=600

2) postgres=# select lo_import('/PATH/TO/rand.dat');
  lo_import
-----------
      16397 [USE THIS ID FOR THE NEXT STEP]
(1 row)

3) postgres=# create table big_data as select (string_agg(data,'')) as 
data from pg_largeobject where loid =16397;
SELECT 1

4) postgres=# select * from big_data;
ERROR:  invalid memory alloc request size 1468006403



-- 
Anna Akenteva
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: autovacuum: change priority of the vacuumed tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] [bug-fix] Cannot select big bytea values (~600MB)