pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: varuzam@gmail.com
Subject: BUG #15729: Error 'invalid memory alloc request size' during updating a big xml field
Date: Tue, 02 Apr 2019 15:53:33 +0000
Message-ID: <15729-bb65cf975dd7c6ca@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15729
Logged by:          Kent
Email address:      varuzam@gmail.com
PostgreSQL version: 11.2
Operating system:   Centos 7 64bit
Description:        

Hello
I have a table with big records
```
test=# \d xrecords 
                 Table "public.xrecords"
 Column |     Type      | Collation | Nullable | Default 
--------+---------------+-----------+----------+---------
 recid  | character(19) |           | not null | 
 detail | xml           |           |          | 
 data   | oid           |           |          | 
Indexes:
    "recidkey" PRIMARY KEY, btree (recid)
    "delete_ix" btree (text((xpath('/detail/delete_date/text()'::text,
detail))[1]))
Triggers:
    delete_all_trigger BEFORE TRUNCATE ON xrecords FOR EACH STATEMENT
EXECUTE PROCEDURE clean_all_data()
    delete_trigger BEFORE DELETE ON xrecords FOR EACH ROW EXECUTE PROCEDURE
clean_data()
    insert_or_update_trigger BEFORE INSERT ON xrecords FOR EACH ROW EXECUTE
PROCEDURE insert_or_update()
    update_trigger BEFORE UPDATE ON xrecords FOR EACH ROW EXECUTE PROCEDURE
clean_data()


test=# select length(detail::text) from xrecords WHERE
recid='GU20190309070000020' ;
  length   
-----------
 493514189
```

The error occurs during this query
```
test=# UPDATE xrecords SET detail = XMLPARSE (DOCUMENT
replace(text(detail),'<update_date>','<delete_date>2019-04-01
10:04:05</delete_date><update_date>')) WHERE recid='GU20190309070000020' AND
text((xpath('/detail/delete_date/text()', detail))[1]) IS NULL;

ERROR:  invalid memory alloc request size 1974056760
```

is it a bug?



Message-ID: <15729-bb65cf975dd7c6ca@postgresql.org>
Permalink:  ../15729-bb65cf975dd7c6ca@postgresql.org/
Also on:    postgresql.org/message-id/15729-bb65cf975dd7c6ca@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, varuzam@gmail.com
  Subject: Re: BUG #15729: Error 'invalid memory alloc request size' during updating a big xml field
  In-Reply-To: <15729-bb65cf975dd7c6ca@postgresql.org>
  References: <15729-bb65cf975dd7c6ca@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox