Re: crosstab function

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: crosstab function
Date: 2019-02-27 04:42:32
Message-ID: be0eedb1-4c01-4c30-1d66-2dffe4b78ef2@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2019-02-27 04:52:10 Re: crosstab function
Previous Message Adrian Klaver 2019-02-27 03:33:17 Re: crosstab function