]> granicus.if.org Git - postgresql/blob - src/man/postgres.1
09767c52c7eee67c2551722efa061e46513aa983
[postgresql] / src / man / postgres.1
1 .\" This is -*-nroff-*-
2 .\" XXX standard disclaimer belongs here....
3 .\" $Header: /cvsroot/pgsql/src/man/Attic/postgres.1,v 1.4 1996/12/11 22:58:14 momjian Exp $
4 .TH POSTGRES95 UNIX 12/08/96 Postgres95 Postgres95
5 .SH NAME
6 postgres \(em the Postgres backend server
7 .SH SYNOPSIS
8 .BR "postgres"
9 [\c
10 .BR "-B"
11 n_buffers]
12 [\c
13 .BR "-D"
14 data_directory]
15 [\c
16 .BR "-E"
17 ]
18 [\c
19 .BR "-F"
20 ]
21 .br
22 [\c
23 .BR "-P"
24 filedes]
25 [\c
26 .BR "-Q"
27 ]
28 .br
29 [\c
30 .BR "-d"
31 debug_level]
32 [\c
33 .BR "-o"
34 output_file]
35 [\c
36 .BR "-s"
37 ]
38 [dbname]
39 .in -5n
40 .SH DESCRIPTION
41 The Postgres backend server can be executed directly from the user shell.
42 This should be done only while debugging by the DBA, and should not be
43 done while other Postgres backends are being managed by a
44 .IR postmaster
45 on this set of databases.
46 .PP
47 The optional argument
48 .IR dbname
49 specifies the name of the database to be accessed.
50 .IR Dbname
51 defaults to the value of the
52 .SM USER
53 environment variable.
54 .PP
55 The 
56 .IR postgres
57 server understands the following command-line options:
58 .TP 5n
59 .BR "-D" " data_directory"
60 This option specifies the pathname of the directory that contains the
61 database system data (the tables, the catalogs, etc.).  If you don't 
62 specify this option, Postgres uses the value of the PGDATA environment
63 variable.  You must either specify a -D option or set PGDATA.
64  
65 The data directory pathname for a database system is normally determined when
66 the database system is created with
67 .IR initdb ,
68 with a --pgdata option to
69 .IR initdb .
70 .TP
71 .BR "-B" " n_buffers"
72 If the backend is running under the 
73 .IR postmaster ,
74 .IR "n_buffers"
75 is the number of shared-memory buffers that the
76 .IR "postmaster"
77 has allocated for the backend server processes that it starts.  If the
78 backend is running standalone, this specifies the number of buffers to
79 allocate.  This value defaults to 64.
80 .TP
81 .BR "-E"
82 Echo all queries.
83 .TP
84 .BR "-F"
85 Disable automatic fsync() call after each transaction.
86 This option improves performance, but an operating system crash
87 while a transaction is in progress will probably cause data loss.
88 .TP
89 .BR "-P" " filedes"
90 .IR "filedes"
91 specifies the file descriptor that corresponds to the socket (port) on
92 which to communicate to the frontend process.  This option is 
93 .BR not
94 useful for interactive use.
95 .TP
96 .BR "-Q"
97 Specifies \*(lqquiet\*(rq mode.
98 .TP
99 .BR "-d" " debug_level"
100 Turns on debugging at the numeric level
101 .IR "debug_level" .
102 Turning on debugging will cause query, parse trees, and query plans to
103 be displayed.
104 .TP
105 .BR "-o" " output_file"
106 Sends all debugging and error output to 
107 .IR output_file .
108 If the backend is running under the 
109 .IR postmaster ,
110 error messages are still sent to the frontend process as well as to
111 .IR output_file ,
112 but debugging output is sent to the controlling tty of the
113 .IR postmaster
114 (since only one file descriptor can be sent to an actual file).
115 .TP
116 .BR "-s"
117 Print time information and other statistics at the end of each query.
118 This is useful for benchmarking or for use in tuning the number of
119 buffers.
120 .SH "DEPRECATED COMMAND OPTIONS"
121 There are several other options that may be specified, used mainly
122 for debugging purposes.  These are listed here only for the use by
123 Postgres system developers.
124 .BR "Use of any of these options is highly discouraged" .
125 Furthermore, any of these options may disappear or change at any time.
126 .TP
127 .BR "-A" "n|r|b|Q\fIn\fP|X\fIn\fP"
128 .IP
129 This option generates a tremendous amount of output.
130 .TP
131 .BR "-L"
132 Turns off the locking system.
133 .TP
134 .BR "-N"
135 Disables use of newline as a query delimiter.
136 .TP
137 .BR "-S"
138 Indicates that the transaction system can run with the assumption of
139 stable main memory, thereby avoiding the necessary flushing of data
140 and log pages to disk at the end of each transaction system.  This is
141 only used for performance comparisons for stable vs. non-stable
142 storage.  Do not use this in other cases, as recovery after a system
143 crash may be impossible when this option is specified in the absence
144 of stable main memory.
145 .TP
146 .BR "-b"
147 Enables generation of bushy query plan trees (as opposed to left-deep
148 query plans trees).  These query plans are not intended for actual
149 execution; in addition, this flag often causes Postgres to run out of
150 memory.
151 .TP
152 .BR "-f"
153 Forbids the use of particular scan and join methods:
154 .IR s " and " i
155 disable sequential and index scans respectively, while
156 .IR n ", " m " and " h
157 disable nested-loop, merge and hash joins respectively.
158 This is another feature that may not necessarily produce executable
159 plans.
160 .TP
161 .BR "-p"
162 Indicates to the backend server that it has been started by a 
163 .IR postmaster
164 and make different assumptions about buffer pool management, file
165 descriptors, etc.
166 .TP
167 .BR "-t" "pa[rser]|pl[anner]|e[xecutor]"
168 Print timing statistics for each query relating to each of the major
169 system modules.  This option cannot be used with
170 .BR "-s" .
171 .SH "SEE ALSO"
172 ipcclean(1),
173 psql(1), 
174 postmaster(1).
175 .SH "DIAGNOSTICS"
176 Of the nigh-infinite number of error messages you may see when you
177 execute the backend server directly, the most common will probably be:
178 .TP
179 .BR "semget: No space left on device"
180 If you see this message, you should run the
181 .IR ipcclean
182 command.  After doing this, try starting
183 .IR postgres
184 again.  If this still doesn't work, you probably need to configure
185 your kernel for shared memory and semaphores as described in the
186 installation notes.