Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDfS2-0005l2-MU for pgsql-sql@arkaria.postgresql.org; Thu, 03 Sep 2020 02:58:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kDfRz-00046E-KT for pgsql-sql@arkaria.postgresql.org; Thu, 03 Sep 2020 02:58:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDfRz-000466-6s for pgsql-sql@lists.postgresql.org; Thu, 03 Sep 2020 02:58:11 +0000 Received: from smtp125.ord1d.emailsrvr.com ([184.106.54.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDfRw-0001dv-V1 for pgsql-sql@lists.postgresql.org; Thu, 03 Sep 2020 02:58:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=g001.emailsrvr.com; s=20190322-9u7zjiwi; t=1599101886; bh=NhbIj1RLaftUEHk95loRsmhSWsvp4tsyXJ33XXrO3fI=; h=Subject:From:Date:To:From; b=wyg4ElETyzgAJEboe4pKZbLwSgFEQkxPWYoe/ExuyBAUB/QA2KzajyoHXzoMBlrPs SFSlS/v5u3PWG8fp0i29BIc7ZRiYWDez9rMBe1bZ78TPG1lUcmmpBZEmywKl9zcJuB Zq/QY+tZEs+298w//N2bmswQswvtYiDDrW86wB1M= X-Auth-ID: xof@thebuild.com Received: by smtp8.relay.ord1d.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 8E29CC010A; Wed, 2 Sep 2020 22:58:06 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) Subject: Re: Crossing/Rotating table rows to rows and columns From: Christophe Pettus In-Reply-To: <2B732C2C-5DC9-4D66-A54C-90EFF8780541@gmail.com> Date: Wed, 2 Sep 2020 19:58:05 -0700 Cc: pgsql-sql Content-Transfer-Encoding: quoted-printable Message-Id: <82BA6332-81EC-40E4-92AF-5A5254DB32BF@thebuild.com> References: <2B732C2C-5DC9-4D66-A54C-90EFF8780541@gmail.com> To: Iuri Sampaio X-Mailer: Apple Mail (2.3445.9.5) X-Classification-ID: d77af4b9-3bef-434c-a273-023fa9cde9e5-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Sep 2, 2020, at 19:58, Iuri Sampaio wrote: > I've tried to use crosstabN(text sql), to solve the problem directly = in the datasource layer, but apparently tablefunc is not supported in = the datamodel Squema=20 "tablefunc" is an extension, so you will need to create it in your = database before using it: CREATE EXTENSION tablefunc; -- -- Christophe Pettus xof@thebuild.com