Skip to content

Files

Latest commit

 

History

History
 
 

configuration

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--
-- $Id: README.postgresql,v 1.2 2006-12-17 11:39:35 dan Exp $
--
-- Copyright (c) 1998-2003 DVL Software Limited
--

This is out of date - 2020-03-28

+------------------------+
|PostgreSQL Configuration|
+------------------------+

After installing postgresql, you need to to these things:

 1. Initialise the database system:

    su -l pgsql /usr/local/bin/initdb /usr/local/pgsql/data


 2. start the server:

    /usr/local/etc/rc.d/010.pgsql.sh start


 3. Create yourself a user

    # su pgsql
    $ createuser dan
    Shall the new user be allowed to create databases? (y/n) y
    Shall the new user be allowed to create more new users? (y/n) y
    CREATE USER

 4. Create the database

    createdb DBname


 5. Install the crypto

    cd /usr/ports/databases/postgresql7/work/postgresql-7.2/contrib/pgcrypto
    edit Makefile and specify cryptolib = openssl
    gmake
    gmake install


 6. Add crypto to the database

    psql db_name < /usr/local/share/postgresql/contrib/pgcrypto.sql 


 7. Test

    select DIGEST('adfsd', 'md5');


 8. Install the soundex

    cd /usr/ports/databases/postgresql7/work/postgresql-7.2/contrib/fuzzystrmatch
    gmake
    gmake install


 9. Add soundex to the database

    psql db_name < /usr/local/share/postgresql/contrib/fuzzystrmatch.sql 


10. Test

    select levenshtein('MacDonald', 'McDonald');
    select levenshtein('MacDonald', 'Smith');

Then run psql dbname < POSTGRESQL.sql