-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall.sgm
124 lines (120 loc) · 5.07 KB
/
install.sgm
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<sect1>
<title>
Installation
</title>
<sect2>
<title>
Download
</title>
<para>
<application>pgSphere</application> is not part of the <application>PostgreSQL</application> software.
You can download it from the <application>pgSphere</application> homepage
<ulink url="https://github.com/akorotkov/pgsphere"><citetitle>https://github.com/akorotkov/pgsphere</citetitle></ulink>
</para>
</sect2>
<sect2>
<title>
Installation
</title>
<para>
You will need <application>PostgreSQL
9.1</application> or above. We assume that you have
<application>PostgreSQL</application> already compiled and
installed. Please note: Depending on your system configuration mostly you have to be logged in as the system
superuser.
</para>
<para>
There are two ways to compile <application>pgSphere</application>.
The first is to copy the sources into the contribution directory of
<application>PostgreSQL</application>'s source tree
(<filename>POSTGRESQL_SRC/src/contrib</filename>).
Then, change into <filename>POSTGRESQL_SRC/src/contrib</filename>.
If the sources are not yet installed and the directory
<filename>pg_sphere</filename> does not exist, take the
gzipped <application>pgSphere</application> sources ( e. g.,
<filename>pg_sphere_xxx.tgz</filename> ) and run:
</para>
<programlisting>
<![CDATA[shell> tar -xzf path/to/pg_sphere_xxx.tgz]]>
</programlisting>
<para>
Now, change into the <filename>pg_sphere</filename>
directory and run :
</para>
<programlisting>
<![CDATA[shell> make]]>
</programlisting>
<para>
and to install <application>pgSphere</application> :
</para>
<programlisting>
<![CDATA[shell> make install]]>
</programlisting>
<para>
The second way does not require the <application>PostgreSQL</application> sources but
the configuration tool <application>pg_config</application>.
</para>
<para>
First unpack the <application>pgSphere</application> sources:
</para>
<programlisting>
<![CDATA[shell> tar -xzf path_to_pg_sphere_xxx.tgz]]>
</programlisting>
<para>
Now, change into the <filename>pg_sphere</filename>
directory and run:
</para>
<programlisting>
<![CDATA[shell> make USE_PGXS=1 PG_CONFIG=/path/to/pg_config]]>
</programlisting>
<para>
To install <application>pgSphere</application> you have to run :
</para>
<programlisting>
<![CDATA[shell> make USE_PGXS=1 PG_CONFIG=/path/to/pg_config install]]>
</programlisting>
<para>
To check the installation change into the <filename>pg_sphere</filename> source
directory again and run:
</para>
<programlisting>
<![CDATA[shell> make installcheck]]>
</programlisting>
<para>
The check status will be displayed. Please note, the check gives different results with
different <application>PostgreSQL</application>-versions. Currently, the check should
run without errors with <application>PostgreSQL</application>-version 8.4. Otherwise check
the file <filename>regression.diff</filename>.
</para>
</sect2>
<sect2>
<title>
Creating a database with <application>pgSphere</application>
</title>
<para>
We assume you have already created a database
<database>datab</database>, where <database>datab</database>
is the name of any database.
Presupposing the name of your
<application>PostgreSQL</application>'s superuser is
<parameter>postgres</parameter>, type:
</para>
<programlisting>
<![CDATA[shell> psql -U postgres -c 'CREATE EXTENSION pg_sphere;' datab]]>
</programlisting>
<para>
Depending on your system, it may be necessary to give more
<command>psql</command> options like port or host name.
Please have a look at the
<application>PostgreSQL</application> documentation for more
details.
</para>
<para>
To get the version of installed pgSphere software, simply
call:
</para>
<programlisting>
<![CDATA[pgsql> SELECT pg_sphere_version();]]>
</programlisting>
</sect2>
</sect1>