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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
<!--
$PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.17 2003/11/29 19:51:37 pgsql Exp $
-->
<chapter id="install-win32">
<title>Installation on <productname>Windows</productname></title>
<indexterm>
<primary>installation</primary>
<secondary>on Windows</secondary>
</indexterm>
<para>
Although <productname>PostgreSQL</productname> is written for
Unix-like operating systems, the C client library
(<application>libpq</application>) and the interactive terminal
(<application>psql</application>) can be compiled natively under
Windows. The makefiles included in the source distribution are
written for <productname>Microsoft Visual C++</productname> and will
probably not work with other systems. It should be possible to
compile the libraries manually in other cases.
</para>
<tip>
<para>
If you are using Windows 98 or newer you can build and use all of
<productname>PostgreSQL</productname> <quote>the Unix way</quote>
if you install the <productname>Cygwin</productname> toolkit first.
In that case see <xref linkend="installation">.
</para>
</tip>
<para>
To build everything that you can on
<productname>Windows</productname>, change into the
<filename>src</filename> directory and type the command
<screen>
<userinput>nmake /f win32.mak</userinput>
</screen>
This assumes that you have <productname>Visual C++</productname> in
your path.
</para>
<para>
The following files will be built:
<variablelist>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpq.dll</filename></term>
<listitem>
<para>
The dynamically linkable frontend library
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpqdll.lib</filename></term>
<listitem>
<para>
Import library to link your programs to <filename>libpq.dll</filename>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>interfaces\libpq\Release\libpq.lib</filename></term>
<listitem>
<para>
Static library version of the frontend library
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>bin\psql\Release\psql.exe</filename></term>
<listitem>
<para>
The <productname>PostgreSQL</productname> interactive terminal
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
The only file that really needs to be installed is the
<filename>libpq.dll</filename> library. This file should in most
cases be placed in the <filename>WINNT\SYSTEM32</filename> directory
(or in <filename>WINDOWS\SYSTEM</filename> on a Windows 95/98/ME
system). If this file is installed using a setup program, it should
be installed with version checking using the
<symbol>VERSIONINFO</symbol> resource included in the file, to
ensure that a newer version of the library is not overwritten.
</para>
<para>
If you plan to do development using <application>libpq</application> on this machine, you will
have to add the <filename>src\include</filename> and
<filename>src\interfaces\libpq</filename> subdirectories of the
source tree to the include path in your compilers settings.
</para>
<para>
To use the library, you must add the
<filename>libpqdll.lib</filename> file to your project. (In Visual
C++, just right-click on the project and choose to add it.)
</para>
<para>
<application>psql</application> is compiled as a <quote>console
application</>. As the Windows console windows use a different
encoding than the rest of the system, you must take special care
when using 8-bit characters at the <application>psql</application>
prompt. When <application>psql</application> detects a problematic
console code page, it will warn you at startup. To change the
console code page, two things are neccessary:
<itemizedlist>
<listitem>
<para>
Set the code page by entering <userinput>cmd.exe /c chcp
1252</userinput>. (1252 is a code page that is appropriate for
German; replace it with your value.) If you are using Cygwin,
you can put this command in <filename>/etc/profile</filename>.
</para>
</listitem>
<listitem>
<para>
Set the console font to <quote>Lucida Console</>, because the
raster font does not work with the ANSI code page.
</para>
</listitem>
</itemizedlist>
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"./reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
|