Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 399B71337B4B for ; Mon, 18 Oct 2010 15:15:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 26570-04 for ; Mon, 18 Oct 2010 18:15:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id 319071337B49 for ; Mon, 18 Oct 2010 15:15:12 -0300 (ADT) Received: by wyb28 with SMTP id 28so1556590wyb.19 for ; Mon, 18 Oct 2010 11:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=6+7skVNlnIMIeOlv/JHx9cpkdah0YdSIEGrS1P5luUo=; b=cUa2HecEJXy9ymzHnNgMn1uvQsmXkMafAnFlyCSZqrIPS175TxS3QEZCSDhymO/RTy 8FeYTIrnHw4mx9y8PtP6z3P7Yc6sH108ybqdTAFCkPaGnOtvenIQYD7OO3hsxlJBQHG2 f1X7cf/9J68u7Y69WmGe4kFS2ljYylW4LtRKo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=TJPDgWPGGwOFmCpJec3hW4nK6XVjI9ib05AN6/OfYTgvM77HaTtO5i924mehJEKjjs x3zJ6Qp1AaoO26/Mcxs7fmk+Osc53xbcwnu5EfpLfwGckxXJpdxoZ/JLP+zFPbv/CNmt NlNZTqWx07ulybWdbatLyJ8aXXoDWwuVmG+ZQ= Received: by 10.216.231.26 with SMTP id k26mr5008135weq.3.1287425711450; Mon, 18 Oct 2010 11:15:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.206 with HTTP; Mon, 18 Oct 2010 11:14:28 -0700 (PDT) In-Reply-To: <4CBC8B3B.7060708@gmx.net> References: <4CBC8B3B.7060708@gmx.net> From: Pavel Stehule Date: Mon, 18 Oct 2010 20:14:28 +0200 Message-ID: Subject: Re: insert into table from list or array ? To: Andreas Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/46 X-Sequence-Number: 34697 Hello 2010/10/18 Andreas : > =C2=A0Hi, > > 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) Regards Pavel Stehule > 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 col= umn > with those numbers. > Something like > > create temporary table tmptable as select id from > ( 2, 3, 5, 7, 11, 13, 17, 19, 23, 31, > =C2=A037, ... ); > > 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. > > :) > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql >