Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T8wkw-0002HJ-MD for pgsql-general@postgresql.org; Tue, 04 Sep 2012 17:17:42 +0000 Received: from vm-emlprdomr-11.its.yale.edu ([130.132.50.177]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T8wkt-000199-Vz for pgsql-general@postgresql.org; Tue, 04 Sep 2012 17:17:40 +0000 Received: from plattjt.med.yale.edu (plattjt.med.yale.edu [130.132.88.91]) by vm-emlprdomr-11.its.yale.edu (8.14.4/8.14.4) with ESMTP id q84HHX2d014735 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 4 Sep 2012 13:17:37 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: crosstab From: Aram Fingal In-Reply-To: <1346773199616-5722632.post@n5.nabble.com> Date: Tue, 4 Sep 2012 13:15:11 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <96E82B11-77A1-4F55-91B9-82E66D892FF4@multifactorial.com> References: <1346773199616-5722632.post@n5.nabble.com> To: Postgres-General General X-Mailer: Apple Mail (2.1084) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.177 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/88 X-Sequence-Number: 190104 Has anyone tried developing a PLR procedure to do the equivalent of = crosstab but using the Reshape library from R? The reason I ask is that = I have been extracting tables like this with an R script, using = RPostgreSQL, then functions from Reshape and writing the output to a = .csv file. I wonder if a PLR procedure could so this with fewer lines = of code and greater speed. I'm just not clear on how to write the PLR = code.