X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9388CD1C50B for ; Tue, 13 Apr 2004 21:59:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 70996-06 for ; Tue, 13 Apr 2004 21:59:41 -0300 (ADT) Received: from wolverine.lercnetworks.com (sabertooth.lercnetworks.com [140.99.13.90]) by svr1.postgresql.org (Postfix) with ESMTP id ABDACD1B515 for ; Tue, 13 Apr 2004 21:59:37 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) (uid 510) by wolverine.lercnetworks.com with local; Tue, 13 Apr 2004 18:41:52 -0400 From: "Dennis" To: "postgres SQL" Subject: function returning array Date: Tue, 13 Apr 2004 18:41:52 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/123 X-Sequence-Number: 17498 I am trying to return an array from a function and don't seem to be having luck. The function seems to work fine, but if I do assignment to an array variable, I get null in the array elements DECLARE results varchar[]; tmpv varchar; BEGIN -- now call func that returns varchar[] results := parseString(''abc,def,ghi'','',''); tmpv := results[1]; RAISE NOTICE '' tmpv = % '',tmpv; -- tmpv will be null. END; I found reference to this sort of thing not working, but the reference was from several years ago, so I'm not sure if that is still the case or if I am doing something wrong. Do I need to go with returning a set instead? Dennis S pg-user@calico-consulting.com