set.7
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· 7 代码 · 共 164 行
7
164 行
.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $.TH "SET" "" "2008-01-03" "SQL - Language Statements" "SQL Commands".SH NAMESET \- change a run-time parameter.SH SYNOPSIS.sp.nfSET [ SESSION | LOCAL ] \fIconfiguration_parameter\fR { TO | = } { \fIvalue\fR | '\fIvalue\fR' | DEFAULT }SET [ SESSION | LOCAL ] TIME ZONE { \fItimezone\fR | LOCAL | DEFAULT }.sp.fi.SH "DESCRIPTION".PPThe \fBSET\fR command changes run-time configurationparameters. Many of the run-time parameters listed inin the documentation can be changed on-the-fly with\fBSET\fR.(But some require superuser privileges to change, and others cannotbe changed after server or session start.)\fBSET\fR only affects the value used by the currentsession..PPIf \fBSET\fR or \fBSET SESSION\fR is issuedwithin a transaction that is later aborted, the effects of the\fBSET\fR command disappear when the transaction is rolledback. (This behavior represents a change fromPostgreSQL versions prior to 7.3, wherethe effects of \fBSET\fR would not roll back after a latererror.) Once the surrounding transaction is committed, the effectswill persist until the end of the session, unless overridden by another\fBSET\fR..PPThe effects of \fBSET LOCAL\fR last only till the end ofthe current transaction, whether committed or not. A special case is\fBSET\fR followed by \fBSET LOCAL\fR withina single transaction: the \fBSET LOCAL\fR value will beseen until the end of the transaction, but afterwards (if the transactionis committed) the \fBSET\fR value will take effect..SH "PARAMETERS".TP\fBSESSION\fRSpecifies that the command takes effect for the current session.(This is the default if neither SESSION norLOCAL appears.).TP\fBLOCAL\fRSpecifies that the command takes effect for only the currenttransaction. After \fBCOMMIT\fR or \fBROLLBACK\fR,the session-level setting takes effect again. Note that\fBSET LOCAL\fR will appear to have no effect if it isexecuted outside a \fBBEGIN\fR block, since thetransaction will end immediately..TP\fB\fIconfiguration_parameter\fB\fRName of a settable run-time parameter. Available parameters aredocumented in in the documentation and below..TP\fB\fIvalue\fB\fRNew value of parameter. Values can be specified as stringconstants, identifiers, numbers, or comma-separated lists ofthese. DEFAULT can be used to specifyresetting the parameter to its default value..PPBesides the configuration parameters documented in in the documentation, there are a few that can only beadjusted using the \fBSET\fR command or that have aspecial syntax:.TP\fBNAMES\fRSET NAMES \fIvalue\fR is an alias forSET client_encoding TO \fIvalue\fR..TP\fBSEED\fRSets the internal seed for the random number generator (thefunction \fBrandom\fR). Allowed values arefloating-point numbers between 0 and 1, which are thenmultiplied by 231-1.The seed can also be set by invoking the function\fBsetseed\fR:.sp.nfSELECT setseed(\fIvalue\fR);.sp.fi.TP\fBTIME ZONE\fRSET TIME ZONE \fIvalue\fR is an aliasfor SET timezone TO \fIvalue\fR. Thesyntax SET TIME ZONE allows special syntaxfor the time zone specification. Here are examples of validvalues:.RS.TP\fB\&'PST8PDT'\fRThe time zone for Berkeley, California..TP\fB\&'Europe/Rome'\fRThe time zone for Italy..TP\fB-7\fRThe time zone 7 hours west from UTC (equivalentto PDT). Positive values are east from UTC..TP\fBINTERVAL '-08:00' HOUR TO MINUTE\fRThe time zone 8 hours west from UTC (equivalentto PST)..TP\fBLOCAL\fR.TP\fBDEFAULT\fRSet the time zone to your local time zone (the one thatthe server's operating system defaults to)..RE.PPSee in the documentation for more informationabout time zones..PP.PP.SH "NOTES".PPThe function \fBset_config\fR provides equivalentfunctionality. See in the documentation..SH "EXAMPLES".PPSet the schema search path:.sp.nfSET search_path TO my_schema, public;.sp.fi.PPSet the style of date to traditionalPOSTGRES with ``day before month''input convention:.sp.nfSET datestyle TO postgres, dmy;.sp.fi.PPSet the time zone for Berkeley, California:.sp.nfSET TIME ZONE 'PST8PDT';.sp.fi.PPSet the time zone for Italy:.sp.nfSET TIME ZONE 'Europe/Rome';.sp.fi.SH "COMPATIBILITY".PPSET TIME ZONE extends syntax defined in the SQLstandard. The standard allows only numeric time zone offsets whilePostgreSQL allows more flexibletime-zone specifications. All other SETfeatures are PostgreSQL extensions..SH "SEE ALSO"RESET [\fBreset\fR(7)], SHOW [\fBshow\fR(l)]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?