pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Karsten Loesing <karsten.loesing@gmx.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5840: Updating arrays using subscripted assignment results in uninitialized values
Date: Mon, 17 Jan 2011 13:17:03 -0500
Message-ID: <16835.1295288223@sss.pgh.pa.us> (raw)
In-Reply-To: <201101151712.p0FHCBvS019298@wwwmaster.postgresql.org>
References: <201101151712.p0FHCBvS019298@wwwmaster.postgresql.org>

"Karsten Loesing" <karsten.loesing@gmx.net> writes:
> Modifying an array as described in
> http://www.postgresql.org/docs/8.4/static/arrays.html#ARRAYS-MODIFYING
> sometimes leads to uninitialized values.  See the following example:

> CREATE TABLE test_array (my_array BIGINT[]);
> INSERT INTO test_array (my_array) VALUES ('[40:41]={40,41}');
> UPDATE test_array SET my_array[1:2]='{1,2}';
> SELECT * FROM test_array;

They're not actually "uninitialized"; the correct values are inserted,
but then overwritten with garbage.  This seems to have been broken since
8.2 :-(.  Fix committed:
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=f43c4d9ec4d46e4d664af4c1a2a6345921a...

Thanks for the report!

			regards, tom lane



view thread (2+ messages)

Message-ID: <16835.1295288223@sss.pgh.pa.us>
Permalink:  ../16835.1295288223@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16835.1295288223@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, karsten.loesing@gmx.net
  Subject: Re: BUG #5840: Updating arrays using subscripted assignment results in uninitialized values
  In-Reply-To: <16835.1295288223@sss.pgh.pa.us>
  References: <201101151712.p0FHCBvS019298@wwwmaster.postgresql.org> <16835.1295288223@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