GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Installing PostgreSQL

bullet Installing PostgreSQL
To install PostgreSQL on your Virtual Private Servers, connect to your Virtual Private Servers via Telnet or SSH and follow the instructions below.
  1. Install the PostgreSQL software by doing the following, according to your Virtual Private Servers O/S.

    • FreeBSD & Solaris PostgreSQL 7.1.3
      Run this command:

      % vinstall pgsql

      The PostgreSQL installation includes all the necessary PostgreSQL files, initializes a database with the same name as your user name, and activates the postmaster daemon. Several wrapper scripts are available for all PostgreSQL commands. The wrapper scripts are automatically created when PostgreSQL is installed.

      PostgreSQL is installed in a version-specific directory (~/usr/local/pgsql-7.X.X) and a symlink named pgsql is created that points to that directory.

  2. To restore your data using the new psql client, type this:

    % psql -d template1 -f outputfile

 

bullet Configuration
To configure PostgreSQL (which is optional), add the following lines to your shell startup file, according to which shell your Virtual Private Servers is running.

NOTE: To find out which shell your Virtual Private Servers is running, type:

% echo $SHELL

  • /bin/csh
    If you are using /bin/csh or one of its variants, then add the following lines to the ~/.cshrc file on your Virtual Private Servers:

    setenv PGDATA /usr/local/pgsql/data
    setenv PGLIB /usr/local/pgsql/lib
    set path = (/usr/local/pgsql/bin $path)
    

  • /bin/sh & /bin/bash
    If you are using the Bourne shell (/bin/sh or /bin/bash) then add the following lines to the ~/.profile file on your Virtual Private Servers:

    PATH=$PATH:/usr/local/pgsql/bin
    PGDATA=/usr/local/pgsql/data
    PGLIB=/usr/local/pgsql/lib
    export PGDATA PGLIB

 

bullet The psql Client
The main tool for using PostgreSQL is the psql client. To start psql use this command:

% psql

The psql client will start up and you will be able to type in SQL code and ask for help.

NOTE: You may see the following error:

Connection to database '(null)' failed.
FATAL: PQsetdb: Unable to determine a Postgres username!

To resolve this, simply use the following command:

% vpwd_mkdb ~/etc/passwd

This program will read your password file at ~/etc/passwd and create a Berkeley DB format file. PostgreSQL uses this new file to look up user names and account information.

 

bullet Removing PostgreSQL
To remove PostgreSQL from your Virtual Private Servers, connect to your Virtual Private Servers via Telnet or SSH and do the following:
  1. Remove the PostgreSQL software by running the commands that match your Virtual Private Servers O/S.

    • FreeBSD & Solaris PostgreSQL 7.0.3
      Run this command:

      % vuninstall pgsql

  2. Next, edit your ~/etc/rc file, removing the line that contains postmaster.

  3. Then run the ps command, like this:

    % ps -x

    Determine the process ID of the PostgreSQL daemon and use kill to stop the PostgreSQL daemon:

    % kill PROCESS-ID 


Toll Free 1-866-GSP-4400 • 1-301-464-9363 • service@gsp.com
Copyright © 1994-2016 GSP Services, Inc.