Received: from Donald.bks (unknown [203.145.133.13]) by postgresql.org (Postfix) with ESMTP id 4AFC1475451 for ; Wed, 6 Mar 2002 08:59:13 -0500 (EST) Received: from Larry.bks (root@Larry.bks [200.2.1.10]) by Donald.bks (8.11.6/8.11.2) with ESMTP id g26E0lR03700 for ; Wed, 6 Mar 2002 19:30:54 +0530 Received: from localhost (bhuvan@localhost) by Larry.bks (8.9.3/8.8.5) with ESMTP id TAA15969 for ; Wed, 6 Mar 2002 19:24:22 +0530 X-Authentication-Warning: Larry.bks: bhuvan owned process doing -bs Date: Wed, 6 Mar 2002 19:24:22 +0530 (IST) From: Bhuvan A X-Sender: bhuvan@Larry To: pgsql-sql@postgresql.org Subject: inserting arrays from plpgsql. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/63 X-Sequence-Number: 6945 Dear all, i am trying to insert an array from a plpgsql function. But it didnt work and i didnt know where i am wrong. hope to get some lights. my need is something like this.. create table po ( comp_code text, po_no text, po_details text[] ); create table xx ( comp_code text, po_no text, po_line1 text, po_line2 text ); and my function is.. create function ftest() returns opaque as 'declare array_params po.po_details%type; begin array_params := {new.po_line1, new.po_line2}; insert into po values (comp_code, po_no, params) values (new.comp_code, new.po_no, array_params); return new; end;' language 'plpgsql'; create trigger ttest after insert on xx for each row execute procedure ftest(); ---- my need is not exactly the same, but very similar. Will be very happy, if I get some lights! Regards, Bhuvaneswaran.