|
|
| |
| 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.
-
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.
-
To restore your data
using the new psql client, type this:
% psql -d template1 -f outputfile
| |
| 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
|
| |
| 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.
|
| |
| Removing PostgreSQL
| |
To remove PostgreSQL from your Virtual
Private Servers, connect to your Virtual Private Servers via Telnet
or SSH and do the following:
-
Remove the PostgreSQL
software by running the commands that match your Virtual Private
Servers O/S.
-
Next, edit your ~/etc/rc
file, removing the line that contains
postmaster .
-
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.
|