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 1gypyN-0005YJ-Ia for pgsql-general@arkaria.postgresql.org; Wed, 27 Feb 2019 03:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gypyK-0004ji-3v for pgsql-general@arkaria.postgresql.org; Wed, 27 Feb 2019 03:33:28 +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 1gypyI-0004ha-F7 for pgsql-general@lists.postgresql.org; Wed, 27 Feb 2019 03:33: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 1gypyE-000465-00 for pgsql-general@postgresql.org; Wed, 27 Feb 2019 03:33:25 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7DB0221C1B; Tue, 26 Feb 2019 22:33:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 26 Feb 2019 22:33: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=p JQJ/w3hQOGaJclXev6j8lWP0tb5FiAtzWvXBs0y1ig=; b=f8S7TH0oV0wO/cbwX th9ZUrij2u5/kMyLgr46DEkbFCLsvyMnZwmAZaPj/9419ww4v+kQC+LLZcahZSdF zo5b+npDSDKDkTBcsUw/8eraPqSCBw85SO9CB80S1SIXps1OpkXkGZoolCcLOBtu 0C4y1uSmzTszUksn/qa6bzDKhcLTy5yDwl716VFwkV0F2ZdF1IZEVa+8mImQ/M3M fu2LWPWKUxFi0KA8d9MLCuOOyWBDcIOFmIvLzNrVxrjkptBjttioUT638jsxnN2T YOQA5uZUfDw5Jm1f9tgBvg9I6PiNqdAiz7fpWEzPWWEKAkThZzTtdZ8kBxrnWO6U IsYDw== 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=pJQJ/w3hQOGaJclXev6j8lWP0tb5FiAtzWvXBs0y1 ig=; b=SeHxqNVnAJVBzF2f/R5H4TiRu1cnHVRIhAToyajMaar7uVCpW9ARuAMCE dtzqHcKUzBpWsD1r7b433SKTo7fYoWETJDdLC1klJfvRDgYfDBSfElXQzIqLYqiS FQs6AuUXw0HPGgHypkDTYgPoWC3CLOm0yaNPWvKJPPDvu6lpn72K3h+dbb4iiZPB mx1eyu1FZ1jrIp20SWTYEYWz07uQdUaL3VrFdg/0rLoPmAJJO3j4LAURquWYr+7o 9dJCXmhGvoX4/xe7eSoPkbel6kVRDV80ElxZlmhbelsZFidbO1U1sN7Sr0l87MJK 0Rx6SHvTF2/eIDKfuCqJDohQvayVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrvddtgdehkecutefuodetggdotefrodftvf 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 95EF6E4484; Tue, 26 Feb 2019 22:33:18 -0500 (EST) Subject: Re: crosstab function To: Martin Mueller , pgsql-general References: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu> <0322fd1d-542b-d549-10a3-c3ad40646578@aklaver.com> <23ED0D28-943D-44B2-ABA6-3C6D3551EAC8@northwestern.edu> From: Adrian Klaver Message-ID: Date: Tue, 26 Feb 2019 19:33: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: <23ED0D28-943D-44B2-ABA6-3C6D3551EAC8@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 6:10 PM, Martin Mueller wrote: > Thank you for the prompt and clear answer. I work with a Mac (OS 10.4.3) and I used the PostgresApp to install it. I am a very primitive user of Postgres and think of it as Microsoft Access on Steroids. I access it via Aqua Data, Studio, but I don't think that makes any difference My guess is PostgresApp does not include the tablefunc extension. Per Andrews instructions it would helpful to know what error you got when you tried to CREATE EXTENSION tablefunc; > > On 2/26/19, 8:04 PM, "Adrian Klaver" wrote: > > 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 > > -- Adrian Klaver adrian.klaver@aklaver.com