Skip site navigation (1) Skip section navigation (2)

Array assignment behavior (was Re: Stored procedure array limits)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul B(dot) Anderson" <paul(dot)a(at)pnlassociates(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Array assignment behavior (was Re: Stored procedure array limits)
Date: 2006-09-29 16:14:11
Message-ID: 16926.1159546451@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-generalpgsql-hackers
[ expanding this thread, as it now needs wider discussion ]

"Paul B. Anderson" <paul(dot)a(at)pnlassociates(dot)com> writes:
> Actually, I was not filling all of the arrays in sequential order.  I 
> added code to initialize them in order and the function seems to be 
> working now.  Is that a known problem? 

Well, it's a documented behavior: section 8.10.4 saith

	A stored array value can be enlarged by assigning to an element
	adjacent to those already present, or by assigning to a slice
	that is adjacent to or overlaps the data already present.

Up to 8.2 we didn't have a lot of choice about this, because without any
ability to have nulls embedded in arrays, there wasn't any sane thing to
do with the intermediate positions if you assigned to an element not
adjacent to the existing range.  As of 8.2 we could allow assignment to
arbitrary positions by filling the intermediate positions with nulls.
The code hasn't actually been changed to allow that, but it's something
we could consider doing now.

Comments?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2006-09-29 16:22:27
Subject: Re: Block B-Tree concept
Previous:From: Henry B. HotzDate: 2006-09-29 16:01:32
Subject: Re: JAVA Support

pgsql-admin by date

Next:From: Casey DuncanDate: 2006-09-29 16:35:25
Subject: Re: [GENERAL] Array assignment behavior (was Re: Stored procedure array limits)
Previous:From: Paul B. AndersonDate: 2006-09-29 15:12:08
Subject: Re: Stored procedure array limits

pgsql-general by date

Next:From: Casey DuncanDate: 2006-09-29 16:35:25
Subject: Re: [GENERAL] Array assignment behavior (was Re: Stored procedure array limits)
Previous:From: Tom LaneDate: 2006-09-29 15:52:48
Subject: Re: Expected accuracy of planner statistics

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group