Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The only way to install Postgres without root privileges, in home directory, is to compile it from sources. That’s not very difficult.

Usage

No Format
See below for installation
psql --version

 

Installation

No Format
mkdir -p /export/home/YOURSNUMBER/sw/PostgresSQL/src
cd /export/home/YOURSNUMBER/sw/PostgresSQL/src
wget https://github.com/postgres/postgres/archive/master.zip

module load gcc/6.3.0
module load library/zlib/1.2.11
module load python/3.6.1

unzip master.zip
cd /export/home/YOURSNUMBER/sw/PostgresSQL/src/postgres-master

./configure --prefix=/export/home/YOURSNUMBER/sw/PostgresSQL/ --with-python PYTHON=/sw/python/3.6.1/bin/python  2>&1 | tee ConfigureLog.txt
make -j 4 2>&1 | tee MakeLog.txt
make install  2>&1 | tee MakeInstallLog.txt

 

Create database

No Format
~/sw/PostgresSQL/bin/initdb -D ~/sw/PostgresSQL/data/

Start database server:
~/sw/PostgresSQL/bin/postgres -D ~/sw/PostgresSQL/data/
OR:
~/sw/PostgresSQL/bin/pg_ctl -D ~/sw/PostgresSQL/data/ -l logfile start

~/sw/PostgresSQL/bin/psql --version
~/sw/PostgresSQL/bin/psql -U YOURSNUMBER postgres
postgres=# select version();
postgres=# show data_directory ;



 

Reference

 

  1. http://blog.endpoint.com/2013/06/installing-postgresql-without-root.html