Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8F807133655C for ; Mon, 18 Oct 2010 20:04:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 39163-03 for ; Mon, 18 Oct 2010 23:04:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id D77D5133616B for ; Mon, 18 Oct 2010 20:04:30 -0300 (ADT) Received: (qmail invoked by alias); 18 Oct 2010 23:04:29 -0000 Received: from mue-88-130-56-236.dsl.tropolys.de (EHLO [192.168.0.113]) [88.130.56.236] by mail.gmx.net (mp024) with SMTP; 19 Oct 2010 01:04:29 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX18hHlRjQMYh2rU3xYJWn7c7LqcwFpq3SwxicwykEn AnAn7zanconAzT Message-ID: <4CBCD29E.3000304@gmx.net> Date: Tue, 19 Oct 2010 01:05:02 +0200 From: Andreas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: insert into table from list or array ? References: <4CBC8B3B.7060708@gmx.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/47 X-Sequence-Number: 34698 Am 18.10.2010 20:14, schrieb Pavel Stehule: > 2010/10/18 Andreas: >> is it possible to insert into a table from list or an array ? > yes, it's possible > > INSERT INTO tmptab > SELECT v > FROM unnest(string_to_array('1,2,4,2,1',',')) g(v) > Thanks Pavel, though I'm just not yet 100% aware how it works but it works. :)