Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 669671337B8F for ; Mon, 18 Oct 2010 15:00:36 -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 50811-06 for ; Mon, 18 Oct 2010 18:00:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mail.postgresql.org (Postfix) with SMTP id AFB5F1337B90 for ; Mon, 18 Oct 2010 15:00:28 -0300 (ADT) Received: (qmail invoked by alias); 18 Oct 2010 18:00:25 -0000 Received: from mue-88-130-56-236.dsl.tropolys.de (EHLO [192.168.0.113]) [88.130.56.236] by mail.gmx.net (mp005) with SMTP; 18 Oct 2010 20:00:25 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX19lDYRcLHNl2Ze5U0gujt68vQ3NCwxk9EYVs2y5i/ 5q/ESj8gHyNm12 Message-ID: <4CBC8B3B.7060708@gmx.net> Date: Mon, 18 Oct 2010 20:00:27 +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: insert into table from list or array ? 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/44 X-Sequence-Number: 34695 Hi, is it possible to insert into a table from list or an array ? Suppose there is a set of numbers that might be IDs of tables within the DB. To work with them I'd need a temporary table that just holds a single column with those numbers. Something like create temporary table tmptable as select id from ( 2, 3, 5, 7, 11, 13, 17, 19, 23, 31, 37, ... ); would be great. I get those numbers as textfile with 10 numbers per line and devided by comma+space as in the sample above, though the comma+space is negotiable if this were an issue. :)