From: Tom Lane <tgl@sss.pgh.pa.us>
To: Belinda Cussen <belinda.cussen@servian.com.au>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Does anyone know of any issues around ARRAY UNNEST
Date: Sun, 27 Nov 2011 22:30:17 -0500
Message-ID: <4627.1322451017@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+QS4W5uTq1KbWOy+V0wmH1508emS32_eKB8Mm0d43xJtcXSWg@mail.gmail.com>
References: <CA+QS4W6nCLt46KF5WxC49X5pH5mLCP8QSOwzJs+tKzxSQvnx2w@mail.gmail.com>
<CAFj8pRCRUtQrrdYZEAyMRs-T2GrkKXj8uoNF6_WPJPf_B4JaGQ@mail.gmail.com>
<CA+QS4W4u18J4YxHBjpmUX6Gb7EGE31qnf=rEmOVA4ThtLAwZqQ@mail.gmail.com>
<24013.1322414217@sss.pgh.pa.us>
<CA+QS4W5uTq1KbWOy+V0wmH1508emS32_eKB8Mm0d43xJtcXSWg@mail.gmail.com>
Belinda Cussen <belinda.cussen@servian.com.au> writes:
> I've managed to produce this fault consistently now.
> Below is the simplified code:
> CREATE TABLE foo_1 (id int primary key,media_uri TEXT);
> INSERT INTO foo_1(id) SELECT i FROM generate_series(1,1000000) g(i);
> CREATE OR REPLACE FUNCTION bb_crash_db_5 () RETURNS TEXT AS $$
> DECLARE
> v_activity_id_list INTEGER ARRAY;
> BEGIN
> SELECT ARRAY(SELECT id FROM foo_1 ORDER BY id LIMIT 100000) INTO
> v_activity_id_list;
> UPDATE foo_1
> SET media_uri = 'a'
> WHERE id IN (SELECT activity_id FROM UNNEST (v_activity_id_list)
> activity_id)
> ;
> return 'success';
> END;
> $$ LANGUAGE plpgsql;
> I then open 2 command lines and run:
> select bb_crash_db_5();
Thanks, I was able to reproduce it with this test case. It turns out
not to have anything directly to do with UNNEST, but with the code that
deals with concurrent row updates.
I've committed a fix, which will appear in next week's updates.
Thanks for the report and test case!
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, belinda.cussen@servian.com.au, pavel.stehule@gmail.com
Subject: Re: Does anyone know of any issues around ARRAY UNNEST
In-Reply-To: <4627.1322451017@sss.pgh.pa.us>
* 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