mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
213 lines
4.9 KiB
HTML
213 lines
4.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.70)
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
* with significant contributions from:
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>PostgreSQL</TITLE>
|
|
<META NAME="description" CONTENT="PostgreSQL">
|
|
<META NAME="keywords" CONTENT="install">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
<LINK REL="STYLESHEET" HREF="install.css">
|
|
|
|
<LINK REL="next" HREF="node5.html">
|
|
<LINK REL="previous" HREF="node3.html">
|
|
<LINK REL="up" HREF="install.html">
|
|
<LINK REL="next" HREF="node5.html">
|
|
</HEAD>
|
|
|
|
<BODY >
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html98"
|
|
HREF="node5.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
|
|
<A NAME="tex2html94"
|
|
HREF="install.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
|
|
<A NAME="tex2html88"
|
|
HREF="node3.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
|
|
<A NAME="tex2html96"
|
|
HREF="node1.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html99"
|
|
HREF="node5.html">GEOS</A>
|
|
<B> Up:</B> <A NAME="tex2html95"
|
|
HREF="install.html">Building and Installing QGIS</A>
|
|
<B> Previous:</B> <A NAME="tex2html89"
|
|
HREF="node3.html">Getting QGIS</A>
|
|
<B> <A NAME="tex2html97"
|
|
HREF="node1.html">Contents</A></B>
|
|
<BR>
|
|
<BR>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H1><A NAME="SECTION00040000000000000000">
|
|
PostgreSQL</A>
|
|
</H1>
|
|
QGIS uses the latest features of PostgreSQL. For this reason, version 7.4.x or higher is recommended with QGIS version 0.5. If you choose to add PostgreSQL, you must also install PostGIS and the GEOS library (see below).
|
|
|
|
<OL>
|
|
<LI>Download PostgreSQL source from www.postgresql.org
|
|
</LI>
|
|
<LI>Extract the source
|
|
<PRE>
|
|
tar -xzf postgresql-7.4.1.tar.gz
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Change to the source directory
|
|
<PRE>
|
|
cd postgresql-7.4.1
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Configure PostgreSQL:
|
|
<PRE>
|
|
./configure --prefix=/usr/local/pgsql
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Build
|
|
<PRE>
|
|
make
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Install
|
|
<PRE>
|
|
make install
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>As root, create the postgres user and setup the database (following taken from PostgreSQL INSTALL file with modification)
|
|
|
|
<UL>
|
|
<LI>Create the postgres user
|
|
<PRE>
|
|
adduser postgres
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Create the directory for the PostgreSQL database
|
|
<PRE>
|
|
mkdir /usr/local/pgsql/data
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Change ownership of the data directory to the postgres user
|
|
<PRE>
|
|
chown postgres /usr/local/pgsql/data
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>su to the postgres user (or login as postgres)
|
|
<PRE>
|
|
su - postgres
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Change to the PostgreSQL install directory
|
|
<PRE>
|
|
cd /usr/local/pgsql
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Initialize the database
|
|
<PRE>
|
|
./bin/initdb -D /usr/local/pgsql/data
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>Start the PostgreSQL daemon
|
|
<FONT SIZE="-1"> </FONT><PRE>
|
|
./bin/pg_ctl start -o "-i" -D /usr/local/pgsql/data -l /home/postgres/serverlog
|
|
</PRE><FONT SIZE="-1">
|
|
</FONT>
|
|
<P>
|
|
<FONT SIZE="-1">
|
|
</LI>
|
|
<LI>Create the test database
|
|
</FONT>
|
|
<P>
|
|
<PRE>
|
|
./bin/createdb test
|
|
</PRE><FONT SIZE="-1">
|
|
</FONT>
|
|
</LI>
|
|
</UL>
|
|
</LI>
|
|
<LI>PostgreSQL should now be running. Logon as the postgres user (or use su - postgres). You should be able to connect to the test database and execute a test query with the following commands:
|
|
|
|
<P>
|
|
<PRE>
|
|
psql test
|
|
select version();
|
|
version
|
|
-------------------------------------------------------------------------------------
|
|
PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.1 (SuSE Linux)
|
|
(1 row)
|
|
|
|
\q
|
|
</PRE>
|
|
|
|
<P>
|
|
</LI>
|
|
<LI>PostgreSQL install is done
|
|
|
|
</LI>
|
|
</OL>
|
|
|
|
<P>
|
|
<HR>
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html98"
|
|
HREF="node5.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
|
|
<A NAME="tex2html94"
|
|
HREF="install.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
|
|
<A NAME="tex2html88"
|
|
HREF="node3.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
|
|
<A NAME="tex2html96"
|
|
HREF="node1.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html99"
|
|
HREF="node5.html">GEOS</A>
|
|
<B> Up:</B> <A NAME="tex2html95"
|
|
HREF="install.html">Building and Installing QGIS</A>
|
|
<B> Previous:</B> <A NAME="tex2html89"
|
|
HREF="node3.html">Getting QGIS</A>
|
|
<B> <A NAME="tex2html97"
|
|
HREF="node1.html">Contents</A></B>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
Gary Sherman
|
|
2004-10-01
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|