WebFaction
Community site: login faq

Hi, I need to use some of the PostgreSQL contrib modules in one of my projects, specifically soundex and levenshtein. How can I go about installing them on Webfaction, or are they pre-installed out of the box?

asked 19 Apr '11, 04:43

Herman
72712
accept rate: 0%

edited 24 Apr '12, 23:07

ryans ♦♦
5.0k93260


Hi,

You would need to install Postgres to your home directory to use the above modules. Here is how you can do that: 1. Create a new Custom Application (listening on port) in the control panel called "pgport" to reserve a port. Enter it as a shell variable:

PGPORT=35270

Now proceed to install Postgresql:

cd $HOME/src
wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.4.6/postgresql-8.4.6.tar.bz2
tar -xjf postgresql-8.4.6.tar.bz2
cd postgresql-8.4.6
./configure --prefix=$HOME --with-pgport=$PGPORT
make && make install

#set up db
mkdir $HOME/pgsql
$HOME/bin/initdb -D $HOME/pgsql/data

#start server
$HOME/bin/postgres -D $HOME/pgsql/data >> $HOME/pgsql/log 2>&1 &

#create postgres superuser
createuser -s postgres -P

Hope that helps!

permanent link

answered 19 Apr '11, 05:02

neeravk
1.5k3412
accept rate: 41%

So far seems good as to install PostgreSQL itself. But how about the contrib modules? They are not included in the default installation, are they? Usually you do that by running "sudo apt-get install postgresql-contrib", but that doesn't work on webfaction command line. So how should we go about that?

(08 Jan '13, 14:34) Nico

Instead of make && make install you can run make world && make install to build everything that can be built, like documentation and additional modules. See the build section in postgresql's official documentation.

If you only want to install the contrib modules then you can run the make && make install in the contrib directory of the sources tree you have downloaded.

If you want to install only a specific module you would need to traverse to its directory and run the above command. See this page for more info.

(09 Jan '13, 03:16) iliasr ♦♦

I am building postgres v9.3 using these instructions.

I already have a private postgres in my account and that seemed to create a bunch of build subdirectories in my home account: lib, include, share...

If I uses these instructions and set --prefix=$HOME then will i have potentially conflicting or overwritten lib and include files?

Moreover, if later want to build a 3rd postgres (say, pg version 9.4) then should I also use --prefix=$HOME ??

What is the recommended --prefix setting if I want to keep my builds separate? Is it just creating a build area for each product (eg: ~/build/postgres_93 ). Is this the recommend build strategy for multiple postgres builds?

(23 Oct '14, 10:51) twtwt

If I uses these instructions and set --prefix=$HOME then will i have potentially conflicting or overwritten lib and include files?

Yes.

Moreover, if later want to build a 3rd postgres (say, pg version 9.4) then should I also use --prefix=$HOME ??

No.

What is the recommended --prefix setting if I want to keep my builds separate? Is it just creating a build area for each product (eg: ~/build/postgres_93 ). Is this the recommend build strategy for multiple postgres builds?

Yes, exactly that.

(23 Oct '14, 15:05) seanf

Another suggestion from my support ticket:
I think the best way for that would be to create a directory like ~/opt/pgsql and set the prefix for 9.3 to ~/opt/pgsql/9.3 and for the future 9.4 to ~/opt/pgsql/9.4. This is similar to the way most linux distros, like debian or fedora, work when they need to support two postgresql version simultaneously.

(24 Oct '14, 10:05) twtwt

another tip: regarding the default settings in pg_hba.conf file, using 'trust' is not secure in a shared hosting environment.

(28 Oct '14, 16:58) twtwt
showing 5 of 6 show 1 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×102
×2

question asked: 19 Apr '11, 04:43

question was seen: 8,705 times

last updated: 28 Oct '14, 16:58

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM