Skip to content

Instantly share code, notes, and snippets.

@mapbutcher
Created October 23, 2013 01:48
Show Gist options
  • Save mapbutcher/7111217 to your computer and use it in GitHub Desktop.
Save mapbutcher/7111217 to your computer and use it in GitHub Desktop.
Notes on how to install a missing module from PostgreSQL
#Notes on how to install a missing module from PostgreSQL
#Download and Postgresql (no need to make install because we already have it..):
#pre-requisites
sudo apt-get install gcc
sudo apt-get install libreadline-dev
sudo apt-get install zlib1g-dev
wget http://ftp.postgresql.org/pub/source/v9.3.0/postgresql-9.3.0.tar.gz
tar -xzf postgresql-9.3.0.tar.gz
postgresql-9.3.0./configure --prefix=$HOME
make
#Make and install the module:
~/simon_temp/postgresql-9.3.0/contrib/tablefunc$ make
~/simon_temp/postgresql-9.3.0/contrib/tablefunc$ make install
#By default the install directory is not the same as the current install directory, so make sure the required module files are loaded into the current postgres install directory:
sudo /usr/bin/install -c -m 644 ./tablefunc.control '/usr/share/postgresql/9.3/extension/'
sudo /usr/bin/install -c -m 644 ./tablefunc--1.0.sql ./tablefunc--unpackaged--1.0.sql '/usr/share/postgresql/9.3/extension/'
sudo /usr/bin/install -c -m 755 tablefunc.so '/usr/lib/postgresql/9.3/lib/'
#check the extensions
psql -U testuser -d gis
gis=# select * from pg_available_extensions;
name | default_version | installed_version | comment
------------------------+-----------------+-------------------+---------------------------------------------------------------------
postgis_topology | 2.1.0 | 2.1.0 | PostGIS topology spatial types and functions
postgis | 2.1.0 | 2.1.0 | PostGIS geometry, geography, and raster spatial types and functions
plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language
tablefunc | 1.0 | | functions that manipulate whole tables, including crosstab
postgis_tiger_geocoder | 2.1.0 | | PostGIS tiger geocoder and reverse geocoder
(5 rows)
#Create the extension
CREATE EXTENSION tablefunc;
@wilmerg777
Copy link

Thanks for this contribution, it helped me solve a requirement.

Just add that on line 12 of this code it failed to put cd postgresql-9.3.0 and then run ./configure ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment