Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyoaD-0001FP-5w for pgsql-general@arkaria.postgresql.org; Wed, 27 Feb 2019 02:04:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gyoaB-00080m-IU for pgsql-general@arkaria.postgresql.org; Wed, 27 Feb 2019 02:04:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyoa9-0007zC-Lh for pgsql-general@lists.postgresql.org; Wed, 27 Feb 2019 02:04:27 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyoa5-00029s-TP for pgsql-general@postgresql.org; Wed, 27 Feb 2019 02:04:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9F8A721D07; Tue, 26 Feb 2019 21:04:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 26 Feb 2019 21:04:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=5 gMeoh1iY5dOE2hl75A10CGDfFck1o6k3duy3ExcJfc=; b=KHIMWaDKZA5f5QmFJ gLTlH0+oqXN8X5KX9k6Jf/QaqzilNccpFO3/33aEjo3tdL0MhpI4LDTjN6YyQrES m9/TAz9fTIfOzCJ0u9bq+xmh7YkmsFkxKL0T1/MVGIOJJqkhi7J7NgxasSwp/YlS jIqjmNMMnO7HNgEEaX9+nkPsU8XzqWEQNu2d7o1MtyY0vLu+3LnVML++1iSJ3pwj 6elXt0AuOk+ItZGh15CQohkVpIYzP1dXPaWfSWjpGwWe6BY42PlwDZgvt9az+3jh f6Pi9vPj4yxWIY+jvatx1dS8ePvqfOROqRNJClNXMk+9h6tvPwcKbfJjWQxZyc9+ JqEEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=5gMeoh1iY5dOE2hl75A10CGDfFck1o6k3duy3ExcJ fc=; b=HZCD/ZU2uwhkF+82k5gN/WeWj+aSBFdVKBKCcCjb09oyL644M5ikLmsrL cK1D4qq4jgNC97jbJ/gKvicTcTWiJ+7eU7zM9/do7sw6vPThSOIKFRHa/X9wd4VS iUxwsimFOR7GsDOQ0xZK67OolmHjoqOAV3qny8HgKJXnVxK7Db6Qbxw439qWhP90 FQ0zC7Oik0x1kly8k/De6ZH8pq6FWuu1pHZbCwZ2nJzVJdpvyJaC/qz5KCGZABSt Fuzxdms4ao4p+Zmv6Fie1bJZUOU4nCVok8M0Wv8Z6cAQ9ydOU6FmnOOYfrq9hYcH AxjpQunb/Yq576NRlpMocGMlqD0Ig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvddtgdegtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhho mheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvg hrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 6BB44E4549; Tue, 26 Feb 2019 21:04:18 -0500 (EST) Subject: Re: crosstab function To: Martin Mueller , pgsql-general References: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu> From: Adrian Klaver Message-ID: <0322fd1d-542b-d549-10a3-c3ad40646578@aklaver.com> Date: Tue, 26 Feb 2019 18:04:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/26/19 5:51 PM, Martin Mueller wrote: > I run Postgres 10.5.  I understand that there is something called > tablefunc and it includes a crosstab function. On Stack Overflow I learn > that you import this function. But from where and how?  The Postgres > documentation is quite clear and intelligible to a retired English > professor like me, but there is nothing in the Postgres documentation > about how to do the import, and a search for ‘import modules’ yields > nothing. tablefunc is a contrib module so we need to know something information about your Postgres setup: 1) Your OS ? 2) How did you install Postgres? > > I tried to emulate a Stack overflow query that does what I want to do, > but got an error message saying that the crosstab function doesn’t > exist. I tried > > CREATEEXTENSION IFNOTEXISTStablefunc; > > but it did nothing. It doesn’t seem to work  as import statements in > Python do The above depends on the module code actually existing where CREATE EXTENSION can find it. Whether the module exists and where it exists depends on the answers to the questions above. > > ----- > > Martin Mueller > Professor emeritus of English and Classics > > Northwestern University > -- Adrian Klaver adrian.klaver@aklaver.com