⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postgres.1

📁 PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开发团队说,该版本将加速更多企业向该数据库移植.核心开发成员之一Bruce Momjian表示,在新版PostgreSQL
💻 1
📖 第 1 页 / 共 2 页
字号:
\fB-t pa[rser] | pl[anner] | e[xecutor]\fRPrint timing statistics for each query relating to each of themajor system modules. This option cannot be used togetherwith the \fB-s\fR option..TP\fB-T\fRThis option is for debugging problems that cause a serverprocess to die abnormally. The ordinary strategy in thissituation is to notify all other server processes that theymust terminate and then reinitialize the shared memory andsemaphores. This is because an errant server process couldhave corrupted some shared state before terminating. Thisoption specifies that \fBpostgres\fR willstop all other server processes by sending the signalSIGSTOP, but will not cause them toterminate. This permits system programmers to collect coredumps from all server processes by hand..TP\fB-v \fIprotocol\fB\fRSpecifies the version number of the frontend/backend protocolto be used for a particular session. This option is forinternal use only..TP\fB-W \fIseconds\fB\fRA delay of this many seconds occurs when a new server processis started, after it conducts the authentication procedure.This is intended to give an opportunity to attach to theserver process with a debugger..TP\fB-y \fIdatabase\fB\fRIndicates that this is a subprocess started by a parent\fBpostgres\fR process, and specifies the database touse. This option is for internal use only..SS "OPTIONS FOR SINGLE-USER MODE".PPThe following options only apply to the single-user mode..TP\fB--single\fRSelects the single-user mode. This must be the first argumenton the command line..TP\fB\fIdatabase\fB\fRSpecifies the name of the database to be accessed. If it isomitted it defaults to the user name. .TP\fB-E\fREcho all commands..TP\fB-j\fRDisables use of newline as a statement delimiter..TP\fB-r \fIfilename\fB\fRSend all server log output to \fIfilename\fR. In normal multiusermode, this option is ignored, and \fBstderr\fR isused by all processes..SH "ENVIRONMENT".TP\fBPGCLIENTENCODING\fRDefault character encoding used by clients. (The clients mayoverride this individually.) This value can also be set in theconfiguration file..TP\fBPGDATA\fRDefault data directory location.TP\fBPGDATESTYLE\fRDefault value of the datestyle run-timeparameter. (The use of this environment variable is deprecated.).TP\fBPGPORT\fRDefault port (preferably set in the configuration file).TP\fBTZ\fRServer time zone.SH "DIAGNOSTICS".PPA failure message mentioning semget orshmget probably indicates you need to configure yourkernel to provide adequate shared memory and semaphores. For morediscussion see in the documentation. You may be ableto postpone reconfiguring your kernel by decreasing shared_buffers to reduce the shared memoryconsumption of PostgreSQL, and/or by reducingmax_connections to reduce the semaphoreconsumption..PPA failure message suggesting that another server is already runningshould be checked carefully, for example by using the command.sp.nf$ \fBps ax | grep postgres\fR.sp.fior.sp.nf$ \fBps -ef | grep postgres\fR.sp.fidepending on your system. If you are certain that no conflictingserver is running, you may remove the lock file mentioned in themessage and try again..PPA failure message indicating inability to bind to a port mayindicate that that port is already in use by somenon-PostgreSQL process. You may alsoget this error if you terminate \fBpostgres\fRand immediately restart it using the same port; in this case, youmust simply wait a few seconds until the operating system closesthe port before trying again. Finally, you may get this error ifyou specify a port number that your operating system considers tobe reserved. For example, many versions of Unix consider portnumbers under 1024 to be ``trusted'' and only permitthe Unix superuser to access them..SH "NOTES".PPIf at all possible, \fBdo not\fR useSIGKILL to kill the main\fBpostgres\fR server. Doing so will prevent\fBpostgres\fR from freeing the systemresources (e.g., shared memory and semaphores) that it holds beforeterminating. This may cause problems for starting a fresh\fBpostgres\fR run..PPTo terminate the \fBpostgres\fR server normally, thesignals SIGTERM, SIGINT, orSIGQUIT can be used. The first will wait forall clients to terminate before quitting, the second willforcefully disconnect all clients, and the third will quitimmediately without proper shutdown, resulting in a recovery runduring restart. The SIGHUP signal will reloadthe server configuration files. It is also possible to sendSIGHUP to an individual server process, but thatis usually not sensible..PPThe utility command \fBpg_ctl\fR(1) can be used tostart and shut down the \fBpostgres\fR serversafely and comfortably..PPTo cancel a running query, send the SIGINT signalto the process running that command..PPThe \fBpostgres\fR server uses SIGTERMto tell subordinate server processes to quit normally andSIGQUIT to terminate without the normal cleanup.These signals \fBshould not\fR be used by users. Itis also unwise to send SIGKILL to a serverprocess \(em the main \fBpostgres\fR process willinterpret this as a crash and will force all the sibling processesto quit as part of its standard crash-recovery procedure..SH "BUGS".PPThe \fB--\fR options will not work on \fBFreeBSD\fR or \fBOpenBSD\fR.Use \fB-c\fR instead. This is a bug in the affected operatingsystems; a future release of PostgreSQLwill provide a workaround if this is not fixed..SH "USAGE".PPTo start a single-user mode server, use a command like.sp.nf\fBpostgres --single -D /usr/local/pgsql/data \fIother-options\fB my_database\fR.sp.fiProvide the correct path to the database directory with \fB-D\fR, ormake sure that the environment variable \fBPGDATA\fR is set.Also specify the name of the particular database you want to work in..PPNormally, the single-user mode server treats newline as the commandentry terminator; there is no intelligence about semicolons,as there is in \fBpsql\fR. To continue a commandacross multiple lines, you must type backslash just before eachnewline except the last one..PPBut if you use the \fB-j\fR command line switch, then newline doesnot terminate command entry. In this case, the server will read the standard inputuntil the end-of-file (EOF) marker, thenprocess the input as a single command string. Backslash-newline is nottreated specially in this case..PPTo quit the session, type EOF(\fBControl\fR+\fBD\fR, usually).If you'veused \fB-j\fR, two consecutive EOFs are needed to exit..PPNote that the single-user mode server does not provide sophisticatedline-editing features (no command history, for example)..SH "EXAMPLES".PPTo start \fBpostgres\fR in the backgroundusing default values, type:.sp.nf$ \fBnohup postgres >logfile 2>&1 </dev/null &\fR.sp.fi.PPTo start \fBpostgres\fR with a specificport:.sp.nf$ \fBpostgres -p 1234\fR.sp.fiThis command will start up \fBpostgres\fRcommunicating through the port 1234. In order to connect to thisserver using \fBpsql\fR, you would need to run it as.sp.nf$ \fBpsql -p 1234\fR.sp.fior set the environment variable \fBPGPORT\fR:.sp.nf$ \fBexport PGPORT=1234\fR$ \fBpsql\fR.sp.fi.PPNamed run-time parameters can be set in either of these styles:.sp.nf$ \fBpostgres -c work_mem=1234\fR$ \fBpostgres --work-mem=1234\fR.sp.fiEither form overrides whatever setting might exist forwork_mem in \fIpostgresql.conf\fR. Notice thatunderscores in parameter names can be written as either underscoreor dash on the command line. Except for short-term experiments,it's probably better practice to edit the setting in\fIpostgresql.conf\fR than to rely on a command-line switchto set a parameter..SH "SEE ALSO".PP\fBinitdb\fR(1),\fBpg_ctl\fR(1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -