1 | <sect2>
|
---|
2 | <title>Installation of <application>Postgre<acronym>SQL</acronym></application></title>
|
---|
3 |
|
---|
4 | <para>Install <application>Postgre<acronym>SQL</acronym></application> with the following commands: </para>
|
---|
5 |
|
---|
6 | <screen><userinput><command>./configure --prefix=/usr &&
|
---|
7 | make &&
|
---|
8 | make install</command></userinput></screen>
|
---|
9 |
|
---|
10 | <note><para>If you are upgrading an existing system and are going to
|
---|
11 | install the new files over the old ones, then you should
|
---|
12 | back up your data, shut down the old server and follow the
|
---|
13 | instructions in <ulink
|
---|
14 | url="http://www.postgresql.org/docs/7.4/static/install-upgrading.html">the
|
---|
15 | official <application>Postgre<acronym>SQL</acronym></application>
|
---|
16 | documentation</ulink>.</para></note>
|
---|
17 |
|
---|
18 | <para>Initialize a database cluster with the following commands:</para>
|
---|
19 |
|
---|
20 | <screen><userinput><command>mkdir -p /var/pgsql/data &&
|
---|
21 | useradd -d /var/pgsql/data postgres &&
|
---|
22 | chown postgres /var/pgsql/data &&
|
---|
23 | su - postgres -c '/usr/bin/initdb -D /var/pgsql/data'</command></userinput></screen>
|
---|
24 |
|
---|
25 | <para>Start the database server with the following command:</para>
|
---|
26 |
|
---|
27 | <screen><userinput><command>su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > \
|
---|
28 | /var/pgsql/data/logfile 2>&1 &'</command></userinput></screen>
|
---|
29 |
|
---|
30 | <para>Create a database and verify the installation:</para>
|
---|
31 |
|
---|
32 | <screen><userinput><command>su - postgres -c '/usr/bin/createdb test' &&
|
---|
33 | echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
|
---|
34 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
35 | echo "insert into t1 values ('Billy', 'NewYork');" \
|
---|
36 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
37 | echo "insert into t1 values ('Evanidus', 'Quebec');" \
|
---|
38 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
39 | echo "insert into t1 values ('Jesse', 'Ontario');" \
|
---|
40 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
41 | echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</command></userinput></screen>
|
---|
42 |
|
---|
43 | </sect2>
|
---|