Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T90KU-00018M-Fp for pgsql-general@postgresql.org; Tue, 04 Sep 2012 21:06:38 +0000 Received: from wsip-72-214-29-243.sd.sd.cox.net ([72.214.29.243] helo=joeconway.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T90KS-0004Np-IL for pgsql-general@postgresql.org; Tue, 04 Sep 2012 21:06:37 +0000 Received: from www.joeconway.com (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 12269205; Tue, 04 Sep 2012 14:06:35 -0700 Message-ID: <50466D5B.3060101@joeconway.com> Date: Tue, 04 Sep 2012 14:06:35 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.5.0.12-3.fc6 pango-text Thunderbird/1.5.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Aram Fingal CC: Postgres-General General Subject: Re: crosstab References: <1346773199616-5722632.post@n5.nabble.com> <1346784707.8977.6.camel@asus-1001PX.home> <73FF0C6A-965B-4456-BA90-2B8FD1CBC118@multifactorial.com> <504655DD.4030701@joeconway.com> <09AE4623-B1E5-4F8D-AC55-EF5906A6411C@multifactorial.com> <50465CD9.3050809@joeconway.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.9 (/) X-Archive-Number: 201209/107 X-Sequence-Number: 190123 On 09/04/2012 01:23 PM, Aram Fingal wrote: > So then, PL/R is not a solution to being able to pivot tables > directly in PostgreSQL but I might be able to define a PL/R procedure > which, for example, pivots tables and then uses the write.table() > function of R to send the results to disk without returning any rows > to PostgreSQL? Such a procedure might prove be faster and more > convenient than extracting the data from PostgreSQL into an R > application layer and then writing to disk. As mentioned somewhere else along this thread, I don't know that it will be faster, but it may well be more convenient if your goal is to get a CSV file in the end anyway. Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support