X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1AF033A5B55 for ; Wed, 26 Jan 2005 09:30:03 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92403-03 for ; Wed, 26 Jan 2005 09:29:55 +0000 (GMT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id E2F0A3A5B51 for ; Wed, 26 Jan 2005 09:29:56 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 4.42) id 1CtjTi-000Ets-3d; Wed, 26 Jan 2005 09:28:46 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 71A99178E4; Wed, 26 Jan 2005 09:29:54 +0000 (GMT) Message-ID: <41F76311.5030608@archonet.com> Date: Wed, 26 Jan 2005 09:29:53 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sibtay Abbas Cc: pgsql-sql@postgresql.org Subject: Re: working with multidimensional arrays in plpgsql References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.072 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/251 X-Sequence-Number: 20039 Sibtay Abbas wrote: > hello everyone > > i am having problem with multidimensional arrays in plpgsql following > is the source code of the function which i am trying to run > DECLARE > x INTEGER[10][10]; > x[3][1] := '20'; ------i have even tried x[3][1] = 20 > As you might have observed here, the actual problem is > how to do assignment to multidimensional array locations using the > subscript operater. Actually, the problem is that the array "x" has been initialised to NULL. Therefore, you can't set individual values. Try a line like: x := '{}'; -- Richard Huxton Archonet Ltd