aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/config.sgml
blob: 7f44b8992a27913be87aceb38b2e6cbfe69598a2 (plain)
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<chapter id="config">
<title id="install-config">Configuration Options</title>

<sect1>
<title>Parameters for Configuration (<application>configure</application>)</title>

<para>
The full set of parameters available in <application>configure</application>
can be obtained by typing

<programlisting>
$ ./configure --help
</programlisting>

<para>
The following parameters may be of interest to most installers:

<programlisting>
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local/pgsql]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
--enable and --with options recognized:
  --with-template=<replaceable>template</replaceable>
                          use operating system template file
                              see template directory
  --with-includes=<replaceable>incdir</replaceable>  site header files for tk/tcl, etc in DIR
  --with-libs=<replaceable>incdir</replaceable>      also search for libraries in DIR
  --with-libraries=<replaceable>libdir</replaceable> also search for libraries in DIR
  --enable-locale         enable locale support
  --enable-recode         enable cyrillic recode support
  --with-mb=<replaceable>encoding</replaceable>    enable multi-byte support
  --with-pgport=<replaceable>portnum</replaceable> change default startup port
  --with-tcl              use tcl
  --with-tclconfig=<replaceable>tcldir</replaceable> tclConfig.sh and tkConfig.sh are in DIR
  --with-perl             use perl
  --with-odbc             build ODBC driver package
  --with-odbcinst=<replaceable>odbcdir</replaceable> change default directory for odbcinst.ini
  --enable-cassert        enable assertion checks (debugging)
  --with-CC=<replaceable>compiler</replaceable>      use specific C compiler
  --with-CXX=<replaceable>compiler</replaceable>     use specific C++ compiler
  --with-x                use the X Window System
</programlisting>

<sect1>
<title>Parameters for Building (<application>make</application>)</title>

<para>
Many installation-related parameters can be set in the building
stage of <productname>Postgres</productname> installation.

<para>
In most cases, these parameters should be place in a file,
<filename>Makefile.custom</filename>, intended just for that purpose.
The default distribution does not contain this optional file, so you
will create it using a text editor of your choice. When upgrading installations,
you can simply copy your old Makefile.custom to the new installation before
doing the build.

<synopsis>
make [ <replaceable>variable</replaceable>=<replaceable class="parameter">value</replaceable> [,...] ]
</synopsis>

<para>
A few of the many variables which can be specified are:

<variablelist>
<varlistentry>
<term>
<envar>POSTGRESDIR</envar>

<listitem>
<para>
Top of the installation tree.

<varlistentry>
<term>
<envar>BINDIR</envar>

<listitem>
<para>
Location of applications and utilities.

<varlistentry>
<term>
<envar>LIBDIR</envar>

<listitem>
<para>
Location of object libraries, including shared libraries.

<varlistentry>
<term>
<envar>HEADERDIR</envar>

<listitem>
<para>
Location of include files.

<varlistentry>
<term>
<envar>ODBCINST</envar>

<listitem>
<para>
Location of installation-wide <application>psqlODBC</application>
(<acronym>ODBC</acronym>) configuration file.

</variablelist>

<para>
There are other optional parameters which are not as commonly used.
Many of those listed below are appropriate when doing 
<application>Postgres</application> server code development.

<variablelist>
<varlistentry>
<term>
<envar>CFLAGS</envar>

<listitem>
<para>
Set flags for the C compiler. 
Should be assigned with "+=" to retain relevant default parameters.

<varlistentry>
<term>
YFLAGS

<listitem>
<para>
Set flags for the yacc/bison parser. <option>-v</option> might be
used to help diagnose problems building a new parser.
Should be assigned with "+=" to retain relevant default parameters.

<varlistentry>
<term>
<envar>USE_TCL</envar>

<listitem>
<para>
Enable Tcl interface building.

<varlistentry>
<term>
<envar>HSTYLE</envar>

<listitem>
<para>
DocBook <acronym>HTML</acronym> style sheets for building the 
documentation from scratch.
Not used unless you are developing new documentation from the
DocBook-compatible <acronym>SGML</acronym> source documents in
<filename>doc/src/sgml/</filename>.

<varlistentry>
<term>
<envar>PSTYLE</envar>

<listitem>
<para>
DocBook style sheets for building printed documentation from scratch.
Not used unless you are developing new documentation from the
DocBook-compatible <acronym>SGML</acronym> source documents in
<filename>doc/src/sgml/</filename>.

</variablelist>

<para>
Here is an example <filename>Makefile.custom</filename> for a
PentiumPro Linux system:

<programlisting>
# Makefile.custom
# Thomas Lockhart 1998-03-01

POSTGRESDIR= /opt/postgres/current
CFLAGS+= -m486 # -g -O0
USE_TCL= true
TCL_LIB= -ltcl
X_LIBS= -L/usr/X11/lib
TK_LIB= -ltk

# documentation

HSTYLE= /home/tgl/SGML/db118.d/docbook/html
PSTYLE= /home/tgl/SGML/db118.d/docbook/print
</programlisting>

<Sect1>
<Title>Locale Support</Title>

<Para>
<Note>
<Para>
Written by Oleg Bartunov.
See <ULink url="http://www.sai.msu.su/~megera/postgres/">Oleg's web page</ULink>
 for additional information on locale and Russian language support.

</Para>
</Note>
While doing a project for a company in Moscow, Russia, 
I encountered the problem that postgresql had no
support of national alphabets. After looking for possible workarounds 
I decided to develop support of locale myself.
I'm not a C-programer but already had some experience with locale programming 
when I work with perl
(debugging) and glimpse. After several days of digging through
 the <ProductName>Postgres</ProductName> source tree I made very minor corections to
src/backend/utils/adt/varlena.c and src/backend/main/main.c and got what I needed! 
I did support only for
<envar>LC_CTYPE</envar> and <envar>LC_COLLATE</envar>, 
but later <envar>LC_MONETARY</envar> was added by others. I got many
messages from people about this patch so I decided to send it to developers 
and (to my surprise) it was
incorporated into the <productname>Postgres</productname> distribution.

<Para>
 People often complain that locale doesn't work for them. 
There are several common mistakes: 

<ItemizedList>
<ListItem>
<Para>
     Didn't properly configure postgresql before compilation. 
     You must run configure with --enable-locale option to enable locale support. 
     Didn't setup environment correctly when starting postmaster. 
     You must define environment variables 
<envar>LC_CTYPE</envar> and <envar>LC_COLLATE</envar> 
before running postmaster
     because backend gets information about locale from environment. 
I use following shell script
     (runpostgres): 

<ProgramListing>
     #!/bin/sh

     export LC_CTYPE=koi8-r
     export LC_COLLATE=koi8-r
     postmaster -B 1024 -S -D/usr/local/pgsql/data/ -o '-Fe'
</ProgramListing>

     and run it from rc.local as 

<ProgramListing>
     /bin/su - postgres -c "/home/postgres/runpostgres"
</ProgramListing>

</Para>
</ListItem>
<ListItem>
<Para>
     Broken locale support in OS (for example, locale support in libc 
under Linux several times has changed
     and this caused a lot of problems). Latest perl has also support of 
locale and if locale is broken <command>perl -v</command> will
     complain something like: 

<programlisting>
     8:17[mira]:~/WWW/postgres>setenv LC_CTYPE not_exist
     8:18[mira]:~/WWW/postgres>perl -v
     perl: warning: Setting locale failed.
     perl: warning: Please check that your locale settings:
             LC_ALL = (unset),
             LC_CTYPE = "not_exist",
             LANG = (unset)
         are supported and installed on your system.
     perl: warning: Falling back to the standard locale ("C").
</programlisting>

</Para>
</ListItem>
<ListItem>
<Para>
     Wrong location of locale files!

     Possible locations include: 
<filename>/usr/lib/locale</filename> 
(Linux, Solaris), <filename>/usr/share/locale</filename> (Linux), 
<filename>/usr/lib/nls/loc</filename> (DUX 4.0).

     Check <command>man locale</command> to find the correct location.
Under Linux I did a symbolic link between <filename>/usr/lib/locale</filename> and
     <filename>/usr/share/locale</filename> to be sure that 
the next libc will not break my locale.
</Para>
</ListItem>
</ItemizedList>

<Sect2>
<Title>What are the Benefits?</Title> 

<Para>
You can use ~* and order by operators for strings contain characters 
from national alphabets. Non-english users
definitely need that. If you won't use locale stuff just undefine 
the USE_LOCALE variable. 

<Sect2>
<Title>What are the Drawbacks?</Title>

<Para>
There is one evident drawback of using locale - it's speed! 
So, use locale only if you really need it. 


<Sect1>
<Title>Kerberos Authentication</Title>

<Para>
<productname>Kerberos</productname> is an industry-standard secure authentication
system suitable for distributed computing over a public network.

<sect2>
<title>Availability</title>

<para>
The
<productname>Kerberos</productname>
authentication system is not distributed with <Productname>Postgres</Productname>.  Versions of
<productname>Kerberos</productname>
are typically available as optional software from operating system
vendors.  In addition, a source code distribution may be obtained through
<ulink url="ftp://athena-dist.mit.edu">MIT Project Athena</ulink>.

<note>
<para>
You may wish to obtain the MIT version even if your
vendor provides a version, since some vendor ports have been
deliberately crippled or rendered non-interoperable with the MIT
version.
</note>
Users located outside the United States of America and
Canada are warned that distribution of the actual encryption code in
<productname>Kerberos</productname>
is restricted by U. S. Government export regulations.

<para>
Inquiries regarding your <productname>Kerberos</productname> 
should be directed to your vendor or
<ulink url="info-kerberos@athena.mit.edu">MIT Project Athena</ulink>.
Note that <acronym>FAQL</acronym>s
(Frequently-Asked Questions Lists) are periodically posted to the
<ulink url="mailto:kerberos@ATHENA.MIT.EDU"><productname>Kerberos</productname> mailing list</ulink>
(send
<ulink url="mailto:kerberos-request@ATHENA.MIT.EDU">mail to subscribe</ulink>),
and 
<ulink url="news:comp.protocols.kerberos">USENET news group</ulink>.

<sect2>
<title>Installation</title>

<para>
Installation of 
<productname>Kerberos</productname>
itself is covered in detail in the 
<citetitle>Kerberos Installation Notes</citetitle> .
Make sure that the server key file (the <filename>srvtab</filename>
or <filename>keytab</filename>)
is somehow readable by the <productname>Postgres</productname> account.

<para>
<Productname>Postgres</Productname> and its clients can be compiled to use 
either Version 4 or Version 5 of the MIT
<productname>Kerberos</productname>
protocols by setting the 
<envar>KRBVERS</envar>
variable in the file <filename>src/Makefile.global</filename> to the
appropriate value.  You can also change the location where
 <Productname>Postgres</Productname>
expects to find the associated libraries, header files and its own
server key file.

<para>
After compilation is complete, <Productname>Postgres</Productname>
 must be registered as a <productname>Kerberos</productname>
service.  See the
<citetitle>Kerberos Operations Notes</citetitle>
and related manual pages for more details on registering services.

<sect2>
<title>Operation</title>

<para>
After initial installation, <Productname>Postgres</Productname> 
should operate in all ways as a normal
<productname>Kerberos</productname>
service.  For details on the use of authentication, see the
<citetitle>PostgreSQL User's Guide</citetitle> reference sections
for <application>postmaster</application>
and <application>psql</application>.

<para>
In the 
<productname>Kerberos</productname>
Version 5 hooks, the following assumptions are made about user
and service naming:

<itemizedlist>
<listitem>
<para>
User principal names (anames) are assumed to
contain the actual Unix/<Productname>Postgres</Productname> user name
 in the first component.

<listitem>
<para>
The <Productname>Postgres</Productname> service is assumed to be have two components,
 the service name and a hostname, canonicalized as in Version 4 (i.e., with all domain
suffixes removed).

</itemizedlist>

<para>
<table tocentry="1">
<title>Kerberos Parameter Examples</title>
<titleabbrev>Kerberos</titleabbrev>

<tgroup cols="2">
<thead>
<row>
<entry>
Parameter
</entry>
<entry>
Example
</entry>

<tbody>
<row>
<entry>
user
</entry>
<entry>
frew@S2K.ORG
</entry>

<row>
<entry>
user
</entry>
<entry>
aoki/HOST=miyu.S2K.Berkeley.EDU@S2K.ORG
</entry>

<row>
<entry>
host
</entry>
<entry>
postgres_dbms/ucbvax@S2K.ORG
</entry>
</tbody>
</tgroup>
</table>

<para>
Support for Version 4 will disappear sometime after the production
release of Version 5 by MIT.