From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: crosstab function
Date: Tue, 26 Feb 2019 22:42:32 -0600
Message-ID: <be0eedb1-4c01-4c30-1d66-2dffe4b78ef2@gmail.com> (raw)
In-Reply-To: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu>
References: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu>
On 2/26/19 7: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.
>
> 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
>
Extensions are short bits of sql that create functions for you, and point to
"shared object" executable files. Quite literally, it's extending postgres.
Thus, the actual executable file needs to be somewhere on the computer's
hard drive (specifically, where Postgres expects it to be for your OS).
In the Linux world, for example, there's typically a package you install
named something like postgresql96-contrib-9.6.9-blahblah.rpm. You'd install
that using the OS' package manager, restart postgres and then CREATE
EXTENSION should work.
You'll have to determine whether PostgreApp comes with "contribs". If not,
you'll have to use another source for Pg, like MacPorts.
--
Angular momentum makes the world go 'round.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: crosstab function
In-Reply-To: <be0eedb1-4c01-4c30-1d66-2dffe4b78ef2@gmail.com>
References: <3B0E0069-18FC-476D-90A1-5201891AA52C@northwestern.edu> <be0eedb1-4c01-4c30-1d66-2dffe4b78ef2@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox