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 EAF0BD1EB77 for ; Thu, 1 Apr 2004 21:21:26 +0000 (GMT) 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 06372-08 for ; Thu, 1 Apr 2004 17:21:25 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id A25A5D1B441 for ; Thu, 1 Apr 2004 17:21:09 -0400 (AST) Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 4749085; Thu, 01 Apr 2004 13:22:29 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: pgsql-sql@postgresql.org Subject: Array_append does not work with Array variables in PL/pgSQL? Date: Thu, 1 Apr 2004 13:20:37 -0800 User-Agent: KMail/1.5.4 Cc: mail@joeconway.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404011320.37766.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/2 X-Sequence-Number: 17377 Folks, See if you can spot any mistake I'm making here. I've declared the following array variables in a plpgsql function: v_vals TEXT[]; n_vals TEXT[]; After some manipulation, I try to synch them: n_vals := array_append(n_vals, v_vals[arrloop]); val_result := v_vals[arrloop]; RAISE NOTICE ''orig value %'', val_result; val_result := array_to_string(n_vals, '', ''); RAISE NOTICE ''derived value %'', val_result; And I get: NOTICE: orig value 04/01/2004 NOTICE: derived value NOTICE: orig value 04/01/2004 NOTICE: derived value It seems like I cannot assign new elements to arrays inside a PL/pgsql function. What gives here? PostgreSQL 7.4.1 on Linux. -- -Josh Berkus Aglio Database Solutions San Francisco