forked from FreshPorts/freshports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.postgresql
73 lines (41 loc) · 1.41 KB
/
README.postgresql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--
-- $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