X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 72EDC9DC833 for ; Thu, 29 Dec 2005 14:42:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76679-02 for ; Thu, 29 Dec 2005 14:42:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 9749B9DC827 for ; Thu, 29 Dec 2005 14:42:18 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBTIgIuv022480; Thu, 29 Dec 2005 13:42:18 -0500 (EST) To: "Ken Winter" cc: "'Bricklen Anderson'" , "'PostgreSQL pg-sql list'" Subject: Re: Arrays in PL/pgSQL routines? In-reply-to: <005a01c60ca4$f79e3bb0$6603a8c0@kenxp> References: <005a01c60ca4$f79e3bb0$6603a8c0@kenxp> Comments: In-reply-to "Ken Winter" message dated "Thu, 29 Dec 2005 13:23:28 -0500" Date: Thu, 29 Dec 2005 13:42:18 -0500 Message-ID: <22479.1135881738@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.053 required=5 tests=[AWL=0.053] X-Spam-Score: 0.053 X-Spam-Level: X-Archive-Number: 200512/245 X-Sequence-Number: 23787 "Ken Winter" writes: > That works. (Odd that the initialization seems to be necessary to make it > work.) Thanks! Yes, I'm using version 7.4. Possibly what you're running into is that 7.4 is restrictive about what you can do with an array that's NULL. Until pretty recently, assigning to an element of a NULL array left the array still NULL --- this is an artifact of the fact that the system sees the assignment as a binary operation with the array and the new element as inputs. regards, tom lane