Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
postgres(1)
Edit
PageHistory
Diff
Info
LikePages
POSTGRES !!!POSTGRES NAME SYNOPSIS DESCRIPTION USAGE SEE ALSO ---- !!NAME postgres - run a PostgreSQL server in single-user mode !!SYNOPSIS __postgres__ [[ __-A 0__ | __1__ ] [[ __-B__ ''nbuffers'' ] [[ __-c__ ''name''__=__''value'' ] [[ __-d__ ''debug-level'' ] [[ __-D__ ''datadir'' ] [[ __-e__ ] [[ __-E__ ] [[ __-f s__ | __i__ | __t__ | __n__ | __m__ | __h__ ] [[ __-F__ ] [[ __-i__ ] [[ __-N__ ] [[ __-o__ ''filename'' ] [[ __-O__ ] [[ __-P__ ] [[ __-s__ | __-t pa__ | __pl__ | __ex__ ] [[ __-S__ ''sort-mem'' ] [[ __-W__ ''seconds'' ] [[ __--__''name''__=__''value'' ] ''database'' __postgres__ [[ __-A 0__ | __1__ ] [[ __-B__ ''nbuffers'' ] [[ __-c__ ''name''__=__''value'' ] [[ __-d__ ''debug-level'' ] [[ __-D__ ''datadir'' ] [[ __-e__ ] [[ __-f s__ | __i__ | __t__ | __n__ | __m__ | __h__ ] [[ __-F__ ] [[ __-i__ ] [[ __-o__ ''filename'' ] [[ __-O__ ] [[ __-p__ ''database'' ] [[ __-P__ ] [[ __-s__ | __-t pa__ | __pl__ | __ex__ ] [[ __-S__ ''sort-mem'' ] [[ __-v__ ''protocol-version'' ] [[ __-W__ ''seconds'' ] [[ __--__''name''__=__''value'' ] !!DESCRIPTION The ''postgres'' executable is the actual PostgreSQL server process that processes queries. It is normally not called directly; instead a postmaster(1) multi-user server is started. The second form above is how __postgres__ is invoked by the postmaster(1) (only conceptually, since both ''postmaster'' and ''postgres'' are in fact the same program); it should not be invoked directly this way. The first form invokes the server directly in interactive single-user mode. The primary use for this mode is during bootstrapping by initdb(1). Sometimes it is used for debugging or disaster recovery. When invoked in interactive mode from the shell, the user can enter queries and the results will be printed to the screen, but in a form that is more useful for developers than end users. But note that running a single-user backend is not truly suitable for debugging the server since no realistic interprocess communication and locking will happen. When running a stand-alone backend, the session user will be set to the user with id 1. This user does not actually have to exist, so a stand-alone backend can be used to manually recover from certain kinds of accidental damage to the system catalogs. Implicit superuser powers are granted to the user with id 1 in stand-alone mode. __OPTIONS__ When __postgres__ is started by a postmaster(1) then it inherits all options set by the latter. Additionally, __postgres__-specific options can be passed from the __postmaster__ with the __-o__ switch. You can avoid having to type these options by setting up a configuration file. See the ''Administrator's Guide'' for details. Some (safe) options can also be set from the connecting client in an application-dependent way. For example, if the environment variable __PGOPTIONS__ is set, then libpq-based clients will pass that string to the server, which will interpret it as __postgres__ command-line options. __GENERAL PURPOSE__ The options __-A__, __-B__, __-c__, __-d__, __-D__, __-F__, and __--name__ have the same meanings as for the postmaster(1). __-e__ Sets the default date style to ``European'', which means that the ``day before month'' (rather than month before day) rule is used to interpret ambiguous date input, and that the day is printed before the month in certain date output formats. See the ''PostgreSQL User's Guide'' for more information. __-o__ ''filename'' Sends all debugging and error output to ''filename''. If the backend is running under the __postmaster__, this option is ignored, and the stderr inherited from the __postmaster__ is used. __-P__ Ignore system indexes while scanning/updating system tuples. The __REINDEX__ command for system tables/indexes requires this option to be used. __-s__ Print time information and other statistics at the end of each query. This is useful for benchmarking or for use in tuning the number of buffers. __-S__ ''sort-mem'' Specifies the amount of memory to be used by internal sorts and hashes before resorting to temporary disk files. The value is specified in kilobytes, and defaults to 512 kilobytes. Note that for a complex query, several sorts and/or hashes might be running in parallel, and each one will be allowed to use as much as ''sort-mem'' kilobytes before it starts to put data into temporary files. __OPTIONS FOR STAND-ALONE MODE__ ''database'' Specifies the name of the database to be accessed. If it is omitted it defaults to the user name. __-E__ Echo all queries. __-N__ Disables use of newline as a query delimiter. __SEMI-INTERNAL OPTIONS__ There are several other options that may be specified, used mainly for debugging purposes. These are listed here only for the use by PostgreSQL system developers. __Use of any of these options is highly discouraged.__ Furthermore, any of these options may disappear or change in a future release without notice. __-f { s | i | m | n | h }__ Forbids the use of particular scan and join methods: s and i disable sequential and index scans respectively, while n, m, and h disable nested-loop, merge and hash joins respectively. __Note:__ Neither sequential scans nor nested-loop joins can be disabled completely; the -fs and -fn options simply discourage the optimizer from using those plan types if it has any other alternative. __-i__ Prevents query execution, but shows the plan tree. __-O__ Allows the structure of system tables to be modified. This is used by __initdb__. __-p__ ''database'' Indicates that this server has been started by a __postmaster__ and makes different assumptions about buffer pool management, file descriptors, etc. __-t pa[[rser] | pl[[anner] | e[[xecutor]__ Print timing statistics for each query relating to each of the major system modules. This option cannot be used together with the __-s__ option. __-v__ ''protocol'' Specifies the version number of the frontend/backend protocol to be used for this particular session. __-W__ ''seconds'' As soon as this option is encountered, the process sleeps for the specified amount of seconds. This gives developers time to attach a debugger to the backend process. !!USAGE Start a stand-alone backend with a command like __postgres -D $PGDATA__ ''other-options'' __my_database __Provide the correct path to the database area with __-D__, or make sure that the environment variable __PGDATA__ is set. Also specify the name of the particular database you want to work in. Normally, the stand-alone backend treats newline as the command entry terminator; there is no intelligence about semicolons, as there is in __psql__. To continue a command across multiple lines, you must type backslash just before each newline except the last one. But if you use the __-N__ command line switch, then newline does not terminate command entry. The backend will read the standard input until the end-of-file (EOF) marker, then process the input as a single query string. Backslash-newline is not treated specially in this case. To quit the session, type EOF (__Control__+__D__, usually). If you've used __-N__, two consecutive EOFs are needed to exit. Note that the stand-alone backend does not provide sophisticated line-editing features (no command history, for example). !!SEE ALSO initdb(1), ipcclean(1), postmaster(1) ----
3 pages link to
postgres(1)
:
postmaster(1)
initdb(1)
Man1p
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.