[458342f] | 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 |
|
---|
[785d4d91] | 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 |
|
---|
[458342f] | 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 > \
|
---|
[785d4d91] | 28 | /var/pgsql/data/logfile 2>&1 &'</command></userinput></screen>
|
---|
[458342f] | 29 |
|
---|
[65df9fca] | 30 | <para>Create a database and verify the installation:</para>
|
---|
[458342f] | 31 |
|
---|
[785d4d91] | 32 | <screen><userinput><command>su - postgres -c '/usr/bin/createdb test' &&
|
---|
[458342f] | 33 | echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
|
---|
[785d4d91] | 34 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
[458342f] | 35 | echo "insert into t1 values ('Billy', 'NewYork');" \
|
---|
[785d4d91] | 36 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
[458342f] | 37 | echo "insert into t1 values ('Evanidus', 'Quebec');" \
|
---|
[785d4d91] | 38 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
[458342f] | 39 | echo "insert into t1 values ('Jesse', 'Ontario');" \
|
---|
[785d4d91] | 40 | | (su - postgres -c '/usr/bin/psql test ') &&
|
---|
[458342f] | 41 | echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')</command></userinput></screen>
|
---|
| 42 |
|
---|
| 43 | </sect2>
|
---|