Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 97E3886080B for ; Tue, 24 Apr 2012 19:04:40 -0300 (ADT) Received: from wsip-72-214-29-243.sd.sd.cox.net ([72.214.29.243] helo=joeconway.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SMnqh-0007eN-0J for pgsql-sql@postgresql.org; Tue, 24 Apr 2012 22:04:39 +0000 Received: from [216.7.150.149] (account jconway HELO [192.168.132.207]) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 11946098; Tue, 24 Apr 2012 15:04:24 -0700 Message-ID: <4F972365.7070302@joeconway.com> Date: Tue, 24 Apr 2012 15:04:21 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: David Johnston CC: 'Andreas' , 'Samuel Gendler' , pgsql-sql@postgresql.org Subject: Re: generic crosstab ? References: <4F97069B.7020303@gmx.net> <4F971C7F.7050803@gmx.net> <04d701cd2263$323e1ad0$96ba5070$@yahoo.com> In-Reply-To: <04d701cd2263$323e1ad0$96ba5070$@yahoo.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -0.9 (/) X-Archive-Number: 201204/61 X-Sequence-Number: 36538 On 04/24/2012 02:42 PM, David Johnston wrote: > You must specify the output record structure: > > SELECT crosstab(text, text) AS ( col1_name col1_type [, colN_name > colN_type]* ) > > Whether this relates to the “materialization node” message you are > receiving I have no idea. The error is because you are selecting from a set returning function in the target list rather than the from clause. It should be more like: SELECT * FROM crosstab(text, text) AS ( col1_name col1_type [, colN_name > colN_type]* ) HTH, Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support