My problem is that I can put one value into this array, and that's it.
Any subsequent attempts to put another value elsewhere in the array are
rebuffed, saying that the subscripts are out of range. I don't
understand what I would do "by hand" that would help this.
> -----Original Message-----
> From: Tom Lane [mailto:email@example.com]
> Sent: Thursday, May 15, 2008 12:30 AM
> To: Eliot, Christopher
> Cc: firstname.lastname@example.org
> Subject: Re: [GENERAL] Populating a sparse array piecemeal in plpgsql
> "Eliot, Christopher" <email@example.com> writes:
> > CREATE FUNCTION func1()
> > RETURNS VOID AS $$
> > DECLARE
> > a INTEGER;
> > BEGIN
> > a = 0;
> > a = 0;
> > END;
> > $$ LANGUAGE PLPGSQL;
> > When I run this function, I get:
> > ERROR: array subscript out of range.
> Yeah. I'm afraid that declaration is basically just noise:
> it doesn't do anything for you that "DECLARE a integer;"
> wouldn't do. If you want the array actually filled out to
> the indicated dimensions then you have to do that by hand.
> regards, tom lane
Sent via pgsql-general mailing list (firstname.lastname@example.org)
To make changes to your subscription: