1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>19.11. Client Connection Defaults</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="runtime-config-vacuum.html" title="19.10. Vacuuming" /><link rel="next" href="runtime-config-locks.html" title="19.12. Lock Management" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">19.11. Client Connection Defaults</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="runtime-config-vacuum.html" title="19.10. Vacuuming">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="runtime-config.html" title="Chapter 19. Server Configuration">Up</a></td><th width="60%" align="center">Chapter 19. Server Configuration</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="runtime-config-locks.html" title="19.12. Lock Management">Next</a></td></tr></table><hr /></div><div class="sect1" id="RUNTIME-CONFIG-CLIENT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">19.11. Client Connection Defaults <a href="#RUNTIME-CONFIG-CLIENT" class="id_link">#</a></h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT">19.11.1. Statement Behavior</a></span></dt><dt><span class="sect2"><a href="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-FORMAT">19.11.2. Locale and Formatting</a></span></dt><dt><span class="sect2"><a href="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-PRELOAD">19.11.3. Shared Library Preloading</a></span></dt><dt><span class="sect2"><a href="runtime-config-client.html#RUNTIME-CONFIG-CLIENT-OTHER">19.11.4. Other Defaults</a></span></dt></dl></div><div class="sect2" id="RUNTIME-CONFIG-CLIENT-STATEMENT"><div class="titlepage"><div><div><h3 class="title">19.11.1. Statement Behavior <a href="#RUNTIME-CONFIG-CLIENT-STATEMENT" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="GUC-CLIENT-MIN-MESSAGES"><span class="term"><code class="varname">client_min_messages</code> (<code class="type">enum</code>)
3 <a id="id-1.6.6.14.2.2.1.1.3" class="indexterm"></a>
4 </span> <a href="#GUC-CLIENT-MIN-MESSAGES" class="id_link">#</a></dt><dd><p>
6 <a class="link" href="runtime-config-logging.html#RUNTIME-CONFIG-SEVERITY-LEVELS" title="Table 19.2. Message Severity Levels">message levels</a>
7 are sent to the client.
8 Valid values are <code class="literal">DEBUG5</code>,
9 <code class="literal">DEBUG4</code>, <code class="literal">DEBUG3</code>, <code class="literal">DEBUG2</code>,
10 <code class="literal">DEBUG1</code>, <code class="literal">LOG</code>, <code class="literal">NOTICE</code>,
11 <code class="literal">WARNING</code>, and <code class="literal">ERROR</code>.
12 Each level includes all the levels that follow it. The later the level,
13 the fewer messages are sent. The default is
14 <code class="literal">NOTICE</code>. Note that <code class="literal">LOG</code> has a different
15 rank here than in <a class="xref" href="runtime-config-logging.html#GUC-LOG-MIN-MESSAGES">log_min_messages</a>.
17 <code class="literal">INFO</code> level messages are always sent to the client.
18 </p></dd><dt id="GUC-SEARCH-PATH"><span class="term"><code class="varname">search_path</code> (<code class="type">string</code>)
19 <a id="id-1.6.6.14.2.2.2.1.3" class="indexterm"></a>
20 <a id="id-1.6.6.14.2.2.2.1.4" class="indexterm"></a>
21 </span> <a href="#GUC-SEARCH-PATH" class="id_link">#</a></dt><dd><p>
22 This variable specifies the order in which schemas are searched
23 when an object (table, data type, function, etc.) is referenced by a
24 simple name with no schema specified. When there are objects of
25 identical names in different schemas, the one found first
26 in the search path is used. An object that is not in any of the
27 schemas in the search path can only be referenced by specifying
28 its containing schema with a qualified (dotted) name.
30 The value for <code class="varname">search_path</code> must be a comma-separated
31 list of schema names. Any name that is not an existing schema, or is
32 a schema for which the user does not have <code class="literal">USAGE</code>
33 permission, is silently ignored.
35 If one of the list items is the special name
36 <code class="literal">$user</code>, then the schema having the name returned by
37 <code class="function">CURRENT_USER</code> is substituted, if there is such a schema
38 and the user has <code class="literal">USAGE</code> permission for it.
39 (If not, <code class="literal">$user</code> is ignored.)
41 The system catalog schema, <code class="literal">pg_catalog</code>, is always
42 searched, whether it is mentioned in the path or not. If it is
43 mentioned in the path then it will be searched in the specified
44 order. If <code class="literal">pg_catalog</code> is not in the path then it will
45 be searched <span class="emphasis"><em>before</em></span> searching any of the path items.
47 Likewise, the current session's temporary-table schema,
48 <code class="literal">pg_temp_<em class="replaceable"><code>nnn</code></em></code>, is always searched if it
49 exists. It can be explicitly listed in the path by using the
50 alias <code class="literal">pg_temp</code><a id="id-1.6.6.14.2.2.2.2.5.3" class="indexterm"></a>. If it is not listed in the path then
51 it is searched first (even before <code class="literal">pg_catalog</code>). However,
52 the temporary schema is only searched for relation (table, view,
53 sequence, etc.) and data type names. It is never searched for
54 function or operator names.
56 When objects are created without specifying a particular target
57 schema, they will be placed in the first valid schema named in
58 <code class="varname">search_path</code>. An error is reported if the search
61 The default value for this parameter is
62 <code class="literal">"$user", public</code>.
63 This setting supports shared use of a database (where no users
64 have private schemas, and all share use of <code class="literal">public</code>),
65 private per-user schemas, and combinations of these. Other
66 effects can be obtained by altering the default search path
67 setting, either globally or per-user.
69 For more information on schema handling, see
70 <a class="xref" href="ddl-schemas.html" title="5.10. Schemas">Section 5.10</a>. In particular, the default
71 configuration is suitable only when the database has a single user or
72 a few mutually-trusting users.
74 The current effective value of the search path can be examined
75 via the <acronym class="acronym">SQL</acronym> function
76 <code class="function">current_schemas</code>
77 (see <a class="xref" href="functions-info.html" title="9.27. System Information Functions and Operators">Section 9.27</a>).
78 This is not quite the same as
79 examining the value of <code class="varname">search_path</code>, since
80 <code class="function">current_schemas</code> shows how the items
81 appearing in <code class="varname">search_path</code> were resolved.
82 </p></dd><dt id="GUC-ROW-SECURITY"><span class="term"><code class="varname">row_security</code> (<code class="type">boolean</code>)
83 <a id="id-1.6.6.14.2.2.3.1.3" class="indexterm"></a>
84 </span> <a href="#GUC-ROW-SECURITY" class="id_link">#</a></dt><dd><p>
85 This variable controls whether to raise an error in lieu of applying a
86 row security policy. When set to <code class="literal">on</code>, policies apply
87 normally. When set to <code class="literal">off</code>, queries fail which would
88 otherwise apply at least one policy. The default is <code class="literal">on</code>.
89 Change to <code class="literal">off</code> where limited row visibility could cause
90 incorrect results; for example, <span class="application">pg_dump</span> makes that
91 change by default. This variable has no effect on roles which bypass
92 every row security policy, to wit, superusers and roles with
93 the <code class="literal">BYPASSRLS</code> attribute.
95 For more information on row security policies,
96 see <a class="xref" href="sql-createpolicy.html" title="CREATE POLICY"><span class="refentrytitle">CREATE POLICY</span></a>.
97 </p></dd><dt id="GUC-DEFAULT-TABLE-ACCESS-METHOD"><span class="term"><code class="varname">default_table_access_method</code> (<code class="type">string</code>)
98 <a id="id-1.6.6.14.2.2.4.1.3" class="indexterm"></a>
99 </span> <a href="#GUC-DEFAULT-TABLE-ACCESS-METHOD" class="id_link">#</a></dt><dd><p>
100 This parameter specifies the default table access method to use when
101 creating tables or materialized views if the <code class="command">CREATE</code>
102 command does not explicitly specify an access method, or when
103 <code class="command">SELECT ... INTO</code> is used, which does not allow
104 specifying a table access method. The default is <code class="literal">heap</code>.
105 </p></dd><dt id="GUC-DEFAULT-TABLESPACE"><span class="term"><code class="varname">default_tablespace</code> (<code class="type">string</code>)
106 <a id="id-1.6.6.14.2.2.5.1.3" class="indexterm"></a>
107 <a id="id-1.6.6.14.2.2.5.1.4" class="indexterm"></a>
108 </span> <a href="#GUC-DEFAULT-TABLESPACE" class="id_link">#</a></dt><dd><p>
109 This variable specifies the default tablespace in which to create
110 objects (tables and indexes) when a <code class="command">CREATE</code> command does
111 not explicitly specify a tablespace.
113 The value is either the name of a tablespace, or an empty string
114 to specify using the default tablespace of the current database.
115 If the value does not match the name of any existing tablespace,
116 <span class="productname">PostgreSQL</span> will automatically use the default
117 tablespace of the current database. If a nondefault tablespace
118 is specified, the user must have <code class="literal">CREATE</code> privilege
119 for it, or creation attempts will fail.
121 This variable is not used for temporary tables; for them,
122 <a class="xref" href="runtime-config-client.html#GUC-TEMP-TABLESPACES">temp_tablespaces</a> is consulted instead.
124 This variable is also not used when creating databases.
125 By default, a new database inherits its tablespace setting from
126 the template database it is copied from.
128 If this parameter is set to a value other than the empty string
129 when a partitioned table is created, the partitioned table's
130 tablespace will be set to that value, which will be used as
131 the default tablespace for partitions created in the future,
132 even if <code class="varname">default_tablespace</code> has changed since then.
134 For more information on tablespaces,
135 see <a class="xref" href="manage-ag-tablespaces.html" title="22.6. Tablespaces">Section 22.6</a>.
136 </p></dd><dt id="GUC-DEFAULT-TOAST-COMPRESSION"><span class="term"><code class="varname">default_toast_compression</code> (<code class="type">enum</code>)
137 <a id="id-1.6.6.14.2.2.6.1.3" class="indexterm"></a>
138 </span> <a href="#GUC-DEFAULT-TOAST-COMPRESSION" class="id_link">#</a></dt><dd><p>
139 This variable sets the default
140 <a class="link" href="storage-toast.html" title="66.2. TOAST">TOAST</a>
141 compression method for values of compressible columns.
142 (This can be overridden for individual columns by setting
143 the <code class="literal">COMPRESSION</code> column option in
144 <code class="command">CREATE TABLE</code> or
145 <code class="command">ALTER TABLE</code>.)
146 The supported compression methods are <code class="literal">pglz</code> and
147 (if <span class="productname">PostgreSQL</span> was compiled with
148 <code class="option">--with-lz4</code>) <code class="literal">lz4</code>.
149 The default is <code class="literal">pglz</code>.
150 </p></dd><dt id="GUC-TEMP-TABLESPACES"><span class="term"><code class="varname">temp_tablespaces</code> (<code class="type">string</code>)
151 <a id="id-1.6.6.14.2.2.7.1.3" class="indexterm"></a>
152 <a id="id-1.6.6.14.2.2.7.1.4" class="indexterm"></a>
153 </span> <a href="#GUC-TEMP-TABLESPACES" class="id_link">#</a></dt><dd><p>
154 This variable specifies tablespaces in which to create temporary
155 objects (temp tables and indexes on temp tables) when a
156 <code class="command">CREATE</code> command does not explicitly specify a tablespace.
157 Temporary files for purposes such as sorting large data sets
158 are also created in these tablespaces.
160 The value is a list of names of tablespaces. When there is more than
161 one name in the list, <span class="productname">PostgreSQL</span> chooses a random
162 member of the list each time a temporary object is to be created;
163 except that within a transaction, successively created temporary
164 objects are placed in successive tablespaces from the list.
165 If the selected element of the list is an empty string,
166 <span class="productname">PostgreSQL</span> will automatically use the default
167 tablespace of the current database instead.
169 When <code class="varname">temp_tablespaces</code> is set interactively, specifying a
170 nonexistent tablespace is an error, as is specifying a tablespace for
171 which the user does not have <code class="literal">CREATE</code> privilege. However,
172 when using a previously set value, nonexistent tablespaces are
173 ignored, as are tablespaces for which the user lacks
174 <code class="literal">CREATE</code> privilege. In particular, this rule applies when
175 using a value set in <code class="filename">postgresql.conf</code>.
177 The default value is an empty string, which results in all temporary
178 objects being created in the default tablespace of the current
181 See also <a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TABLESPACE">default_tablespace</a>.
182 </p></dd><dt id="GUC-CHECK-FUNCTION-BODIES"><span class="term"><code class="varname">check_function_bodies</code> (<code class="type">boolean</code>)
183 <a id="id-1.6.6.14.2.2.8.1.3" class="indexterm"></a>
184 </span> <a href="#GUC-CHECK-FUNCTION-BODIES" class="id_link">#</a></dt><dd><p>
185 This parameter is normally on. When set to <code class="literal">off</code>, it
186 disables validation of the routine body string during <a class="xref" href="sql-createfunction.html" title="CREATE FUNCTION"><span class="refentrytitle">CREATE FUNCTION</span></a> and <a class="xref" href="sql-createprocedure.html" title="CREATE PROCEDURE"><span class="refentrytitle">CREATE PROCEDURE</span></a>. Disabling validation avoids side
187 effects of the validation process, in particular preventing false
188 positives due to problems such as forward references.
190 to <code class="literal">off</code> before loading functions on behalf of other
191 users; <span class="application">pg_dump</span> does so automatically.
192 </p></dd><dt id="GUC-DEFAULT-TRANSACTION-ISOLATION"><span class="term"><code class="varname">default_transaction_isolation</code> (<code class="type">enum</code>)
193 <a id="id-1.6.6.14.2.2.9.1.3" class="indexterm"></a>
194 <a id="id-1.6.6.14.2.2.9.1.4" class="indexterm"></a>
195 </span> <a href="#GUC-DEFAULT-TRANSACTION-ISOLATION" class="id_link">#</a></dt><dd><p>
196 Each SQL transaction has an isolation level, which can be
197 either <span class="quote">“<span class="quote">read uncommitted</span>”</span>, <span class="quote">“<span class="quote">read
198 committed</span>”</span>, <span class="quote">“<span class="quote">repeatable read</span>”</span>, or
199 <span class="quote">“<span class="quote">serializable</span>”</span>. This parameter controls the
200 default isolation level of each new transaction. The default
201 is <span class="quote">“<span class="quote">read committed</span>”</span>.
203 Consult <a class="xref" href="mvcc.html" title="Chapter 13. Concurrency Control">Chapter 13</a> and <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> for more information.
204 </p></dd><dt id="GUC-DEFAULT-TRANSACTION-READ-ONLY"><span class="term"><code class="varname">default_transaction_read_only</code> (<code class="type">boolean</code>)
205 <a id="id-1.6.6.14.2.2.10.1.3" class="indexterm"></a>
206 <a id="id-1.6.6.14.2.2.10.1.4" class="indexterm"></a>
207 </span> <a href="#GUC-DEFAULT-TRANSACTION-READ-ONLY" class="id_link">#</a></dt><dd><p>
208 A read-only SQL transaction cannot alter non-temporary tables.
209 This parameter controls the default read-only status of each new
210 transaction. The default is <code class="literal">off</code> (read/write).
212 Consult <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> for more information.
213 </p></dd><dt id="GUC-DEFAULT-TRANSACTION-DEFERRABLE"><span class="term"><code class="varname">default_transaction_deferrable</code> (<code class="type">boolean</code>)
214 <a id="id-1.6.6.14.2.2.11.1.3" class="indexterm"></a>
215 <a id="id-1.6.6.14.2.2.11.1.4" class="indexterm"></a>
216 </span> <a href="#GUC-DEFAULT-TRANSACTION-DEFERRABLE" class="id_link">#</a></dt><dd><p>
217 When running at the <code class="literal">serializable</code> isolation level,
218 a deferrable read-only SQL transaction may be delayed before
219 it is allowed to proceed. However, once it begins executing
220 it does not incur any of the overhead required to ensure
221 serializability; so serialization code will have no reason to
222 force it to abort because of concurrent updates, making this
223 option suitable for long-running read-only transactions.
225 This parameter controls the default deferrable status of each
226 new transaction. It currently has no effect on read-write
227 transactions or those operating at isolation levels lower
228 than <code class="literal">serializable</code>. The default is <code class="literal">off</code>.
230 Consult <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> for more information.
231 </p></dd><dt id="GUC-TRANSACTION-ISOLATION"><span class="term"><code class="varname">transaction_isolation</code> (<code class="type">enum</code>)
232 <a id="id-1.6.6.14.2.2.12.1.3" class="indexterm"></a>
233 <a id="id-1.6.6.14.2.2.12.1.4" class="indexterm"></a>
234 </span> <a href="#GUC-TRANSACTION-ISOLATION" class="id_link">#</a></dt><dd><p>
235 This parameter reflects the current transaction's isolation level.
236 At the beginning of each transaction, it is set to the current value
237 of <a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TRANSACTION-ISOLATION">default_transaction_isolation</a>.
238 Any subsequent attempt to change it is equivalent to a <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> command.
239 </p></dd><dt id="GUC-TRANSACTION-READ-ONLY"><span class="term"><code class="varname">transaction_read_only</code> (<code class="type">boolean</code>)
240 <a id="id-1.6.6.14.2.2.13.1.3" class="indexterm"></a>
241 <a id="id-1.6.6.14.2.2.13.1.4" class="indexterm"></a>
242 </span> <a href="#GUC-TRANSACTION-READ-ONLY" class="id_link">#</a></dt><dd><p>
243 This parameter reflects the current transaction's read-only status.
244 At the beginning of each transaction, it is set to the current value
245 of <a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TRANSACTION-READ-ONLY">default_transaction_read_only</a>.
246 Any subsequent attempt to change it is equivalent to a <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> command.
247 </p></dd><dt id="GUC-TRANSACTION-DEFERRABLE"><span class="term"><code class="varname">transaction_deferrable</code> (<code class="type">boolean</code>)
248 <a id="id-1.6.6.14.2.2.14.1.3" class="indexterm"></a>
249 <a id="id-1.6.6.14.2.2.14.1.4" class="indexterm"></a>
250 </span> <a href="#GUC-TRANSACTION-DEFERRABLE" class="id_link">#</a></dt><dd><p>
251 This parameter reflects the current transaction's deferrability status.
252 At the beginning of each transaction, it is set to the current value
253 of <a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TRANSACTION-DEFERRABLE">default_transaction_deferrable</a>.
254 Any subsequent attempt to change it is equivalent to a <a class="xref" href="sql-set-transaction.html" title="SET TRANSACTION"><span class="refentrytitle">SET TRANSACTION</span></a> command.
255 </p></dd><dt id="GUC-SESSION-REPLICATION-ROLE"><span class="term"><code class="varname">session_replication_role</code> (<code class="type">enum</code>)
256 <a id="id-1.6.6.14.2.2.15.1.3" class="indexterm"></a>
257 </span> <a href="#GUC-SESSION-REPLICATION-ROLE" class="id_link">#</a></dt><dd><p>
258 Controls firing of replication-related triggers and rules for the
260 Possible values are <code class="literal">origin</code> (the default),
261 <code class="literal">replica</code> and <code class="literal">local</code>.
262 Setting this parameter results in discarding any previously cached
264 Only superusers and users with the appropriate <code class="literal">SET</code>
265 privilege can change this setting.
267 The intended use of this setting is that logical replication systems
268 set it to <code class="literal">replica</code> when they are applying replicated
269 changes. The effect of that will be that triggers and rules (that
270 have not been altered from their default configuration) will not fire
271 on the replica. See the <a class="link" href="sql-altertable.html" title="ALTER TABLE"><code class="command">ALTER TABLE</code></a> clauses
272 <code class="literal">ENABLE TRIGGER</code> and <code class="literal">ENABLE RULE</code>
273 for more information.
275 PostgreSQL treats the settings <code class="literal">origin</code> and
276 <code class="literal">local</code> the same internally. Third-party replication
277 systems may use these two values for their internal purposes, for
278 example using <code class="literal">local</code> to designate a session whose
279 changes should not be replicated.
281 Since foreign keys are implemented as triggers, setting this parameter
282 to <code class="literal">replica</code> also disables all foreign key checks,
283 which can leave data in an inconsistent state if improperly used.
284 </p></dd><dt id="GUC-STATEMENT-TIMEOUT"><span class="term"><code class="varname">statement_timeout</code> (<code class="type">integer</code>)
285 <a id="id-1.6.6.14.2.2.16.1.3" class="indexterm"></a>
286 </span> <a href="#GUC-STATEMENT-TIMEOUT" class="id_link">#</a></dt><dd><p>
287 Abort any statement that takes more than the specified amount of time.
288 If <code class="varname">log_min_error_statement</code> is set
289 to <code class="literal">ERROR</code> or lower, the statement that timed out
291 If this value is specified without units, it is taken as milliseconds.
292 A value of zero (the default) disables the timeout.
294 The timeout is measured from the time a command arrives at the
295 server until it is completed by the server. If multiple SQL
296 statements appear in a single simple-query message, the timeout
297 is applied to each statement separately.
298 (<span class="productname">PostgreSQL</span> versions before 13 usually
299 treated the timeout as applying to the whole query string.)
300 In extended query protocol, the timeout starts running when any
301 query-related message (Parse, Bind, Execute, Describe) arrives, and
302 it is canceled by completion of an Execute or Sync message.
304 Setting <code class="varname">statement_timeout</code> in
305 <code class="filename">postgresql.conf</code> is not recommended because it would
307 </p></dd><dt id="GUC-TRANSACTION-TIMEOUT"><span class="term"><code class="varname">transaction_timeout</code> (<code class="type">integer</code>)
308 <a id="id-1.6.6.14.2.2.17.1.3" class="indexterm"></a>
309 </span> <a href="#GUC-TRANSACTION-TIMEOUT" class="id_link">#</a></dt><dd><p>
310 Terminate any session that spans longer than the specified amount of
311 time in a transaction. The limit applies both to explicit transactions
312 (started with <code class="command">BEGIN</code>) and to an implicitly started
313 transaction corresponding to a single statement.
314 If this value is specified without units, it is taken as milliseconds.
315 A value of zero (the default) disables the timeout.
317 If <code class="varname">transaction_timeout</code> is shorter or equal to
318 <code class="varname">idle_in_transaction_session_timeout</code> or <code class="varname">statement_timeout</code>
319 then the longer timeout is ignored.
321 Setting <code class="varname">transaction_timeout</code> in
322 <code class="filename">postgresql.conf</code> is not recommended because it would
324 </p><div class="note"><h3 class="title">Note</h3><p>
325 Prepared transactions are not subject to this timeout.
326 </p></div></dd><dt id="GUC-LOCK-TIMEOUT"><span class="term"><code class="varname">lock_timeout</code> (<code class="type">integer</code>)
327 <a id="id-1.6.6.14.2.2.18.1.3" class="indexterm"></a>
328 </span> <a href="#GUC-LOCK-TIMEOUT" class="id_link">#</a></dt><dd><p>
329 Abort any statement that waits longer than the specified amount of
330 time while attempting to acquire a lock on a table, index,
331 row, or other database object. The time limit applies separately to
332 each lock acquisition attempt. The limit applies both to explicit
333 locking requests (such as <code class="command">LOCK TABLE</code>, or <code class="command">SELECT
334 FOR UPDATE</code> without <code class="literal">NOWAIT</code>) and to implicitly-acquired
336 If this value is specified without units, it is taken as milliseconds.
337 A value of zero (the default) disables the timeout.
339 Unlike <code class="varname">statement_timeout</code>, this timeout can only occur
340 while waiting for locks. Note that if <code class="varname">statement_timeout</code>
341 is nonzero, it is rather pointless to set <code class="varname">lock_timeout</code> to
342 the same or larger value, since the statement timeout would always
343 trigger first. If <code class="varname">log_min_error_statement</code> is set to
344 <code class="literal">ERROR</code> or lower, the statement that timed out will be
347 Setting <code class="varname">lock_timeout</code> in
348 <code class="filename">postgresql.conf</code> is not recommended because it would
350 </p></dd><dt id="GUC-IDLE-IN-TRANSACTION-SESSION-TIMEOUT"><span class="term"><code class="varname">idle_in_transaction_session_timeout</code> (<code class="type">integer</code>)
351 <a id="id-1.6.6.14.2.2.19.1.3" class="indexterm"></a>
352 </span> <a href="#GUC-IDLE-IN-TRANSACTION-SESSION-TIMEOUT" class="id_link">#</a></dt><dd><p>
353 Terminate any session that has been idle (that is, waiting for a
354 client query) within an open transaction for longer than the
355 specified amount of time.
356 If this value is specified without units, it is taken as milliseconds.
357 A value of zero (the default) disables the timeout.
359 This option can be used to ensure that idle sessions do not hold
360 locks for an unreasonable amount of time. Even when no significant
361 locks are held, an open transaction prevents vacuuming away
362 recently-dead tuples that may be visible only to this transaction;
363 so remaining idle for a long time can contribute to table bloat.
364 See <a class="xref" href="routine-vacuuming.html" title="24.1. Routine Vacuuming">Section 24.1</a> for more details.
365 </p></dd><dt id="GUC-IDLE-SESSION-TIMEOUT"><span class="term"><code class="varname">idle_session_timeout</code> (<code class="type">integer</code>)
366 <a id="id-1.6.6.14.2.2.20.1.3" class="indexterm"></a>
367 </span> <a href="#GUC-IDLE-SESSION-TIMEOUT" class="id_link">#</a></dt><dd><p>
368 Terminate any session that has been idle (that is, waiting for a
369 client query), but not within an open transaction, for longer than
370 the specified amount of time.
371 If this value is specified without units, it is taken as milliseconds.
372 A value of zero (the default) disables the timeout.
374 Unlike the case with an open transaction, an idle session without a
375 transaction imposes no large costs on the server, so there is less
376 need to enable this timeout
377 than <code class="varname">idle_in_transaction_session_timeout</code>.
379 Be wary of enforcing this timeout on connections made through
380 connection-pooling software or other middleware, as such a layer
381 may not react well to unexpected connection closure. It may be
382 helpful to enable this timeout only for interactive sessions,
383 perhaps by applying it only to particular users.
384 </p></dd><dt id="GUC-BYTEA-OUTPUT"><span class="term"><code class="varname">bytea_output</code> (<code class="type">enum</code>)
385 <a id="id-1.6.6.14.2.2.21.1.3" class="indexterm"></a>
386 </span> <a href="#GUC-BYTEA-OUTPUT" class="id_link">#</a></dt><dd><p>
387 Sets the output format for values of type <code class="type">bytea</code>.
388 Valid values are <code class="literal">hex</code> (the default)
389 and <code class="literal">escape</code> (the traditional PostgreSQL
390 format). See <a class="xref" href="datatype-binary.html" title="8.4. Binary Data Types">Section 8.4</a> for more
391 information. The <code class="type">bytea</code> type always
392 accepts both formats on input, regardless of this setting.
393 </p></dd><dt id="GUC-XMLBINARY"><span class="term"><code class="varname">xmlbinary</code> (<code class="type">enum</code>)
394 <a id="id-1.6.6.14.2.2.22.1.3" class="indexterm"></a>
395 </span> <a href="#GUC-XMLBINARY" class="id_link">#</a></dt><dd><p>
396 Sets how binary values are to be encoded in XML. This applies
397 for example when <code class="type">bytea</code> values are converted to
398 XML by the functions <code class="function">xmlelement</code> or
399 <code class="function">xmlforest</code>. Possible values are
400 <code class="literal">base64</code> and <code class="literal">hex</code>, which
401 are both defined in the XML Schema standard. The default is
402 <code class="literal">base64</code>. For further information about
403 XML-related functions, see <a class="xref" href="functions-xml.html" title="9.15. XML Functions">Section 9.15</a>.
405 The actual choice here is mostly a matter of taste,
406 constrained only by possible restrictions in client
407 applications. Both methods support all possible values,
408 although the hex encoding will be somewhat larger than the
410 </p></dd><dt id="GUC-XMLOPTION"><span class="term"><code class="varname">xmloption</code> (<code class="type">enum</code>)
411 <a id="id-1.6.6.14.2.2.23.1.3" class="indexterm"></a>
412 <a id="id-1.6.6.14.2.2.23.1.4" class="indexterm"></a>
413 <a id="id-1.6.6.14.2.2.23.1.5" class="indexterm"></a>
414 </span> <a href="#GUC-XMLOPTION" class="id_link">#</a></dt><dd><p>
415 Sets whether <code class="literal">DOCUMENT</code> or
416 <code class="literal">CONTENT</code> is implicit when converting between
417 XML and character string values. See <a class="xref" href="datatype-xml.html" title="8.13. XML Type">Section 8.13</a> for a description of this. Valid
418 values are <code class="literal">DOCUMENT</code> and
419 <code class="literal">CONTENT</code>. The default is
420 <code class="literal">CONTENT</code>.
422 According to the SQL standard, the command to set this option is
423 </p><pre class="synopsis">
424 SET XML OPTION { DOCUMENT | CONTENT };
426 This syntax is also available in PostgreSQL.
427 </p></dd><dt id="GUC-GIN-PENDING-LIST-LIMIT"><span class="term"><code class="varname">gin_pending_list_limit</code> (<code class="type">integer</code>)
428 <a id="id-1.6.6.14.2.2.24.1.3" class="indexterm"></a>
429 </span> <a href="#GUC-GIN-PENDING-LIST-LIMIT" class="id_link">#</a></dt><dd><p>
430 Sets the maximum size of a GIN index's pending list, which is used
431 when <code class="literal">fastupdate</code> is enabled. If the list grows
432 larger than this maximum size, it is cleaned up by moving
433 the entries in it to the index's main GIN data structure in bulk.
434 If this value is specified without units, it is taken as kilobytes.
435 The default is four megabytes (<code class="literal">4MB</code>). This setting
436 can be overridden for individual GIN indexes by changing
437 index storage parameters.
438 See <a class="xref" href="gin.html#GIN-FAST-UPDATE" title="65.4.4.1. GIN Fast Update Technique">Section 65.4.4.1</a> and <a class="xref" href="gin.html#GIN-TIPS" title="65.4.5. GIN Tips and Tricks">Section 65.4.5</a>
439 for more information.
440 </p></dd><dt id="GUC-CREATEROLE-SELF-GRANT"><span class="term"><code class="varname">createrole_self_grant</code> (<code class="type">string</code>)
441 <a id="id-1.6.6.14.2.2.25.1.3" class="indexterm"></a>
442 </span> <a href="#GUC-CREATEROLE-SELF-GRANT" class="id_link">#</a></dt><dd><p>
443 If a user who has <code class="literal">CREATEROLE</code> but not
444 <code class="literal">SUPERUSER</code> creates a role, and if this
445 is set to a non-empty value, the newly-created role will be granted
446 to the creating user with the options specified. The value must be
447 <code class="literal">set</code>, <code class="literal">inherit</code>, or a
448 comma-separated list of these. The default value is an empty string,
449 which disables the feature.
451 The purpose of this option is to allow a <code class="literal">CREATEROLE</code>
452 user who is not a superuser to automatically inherit, or automatically
453 gain the ability to <code class="literal">SET ROLE</code> to, any created users.
454 Since a <code class="literal">CREATEROLE</code> user is always implicitly granted
455 <code class="literal">ADMIN OPTION</code> on created roles, that user could
456 always execute a <code class="literal">GRANT</code> statement that would achieve
457 the same effect as this setting. However, it can be convenient for
458 usability reasons if the grant happens automatically. A superuser
459 automatically inherits the privileges of every role and can always
460 <code class="literal">SET ROLE</code> to any role, and this setting can be used
461 to produce a similar behavior for <code class="literal">CREATEROLE</code> users
462 for users which they create.
463 </p></dd><dt id="GUC-EVENT-TRIGGERS"><span class="term"><code class="varname">event_triggers</code> (<code class="type">boolean</code>)
464 <a id="id-1.6.6.14.2.2.26.1.3" class="indexterm"></a>
465 </span> <a href="#GUC-EVENT-TRIGGERS" class="id_link">#</a></dt><dd><p>
466 Allow temporarily disabling execution of event triggers in order to
467 troubleshoot and repair faulty event triggers. All event triggers will
468 be disabled by setting it to <code class="literal">false</code>. Setting the value
469 to <code class="literal">true</code> allows all event triggers to fire, this
470 is the default value. Only superusers and users with the appropriate
471 <code class="literal">SET</code> privilege can change this setting.
472 </p></dd><dt id="GUC-RESTRICT-NONSYSTEM-RELATION-KIND"><span class="term"><code class="varname">restrict_nonsystem_relation_kind</code> (<code class="type">string</code>)
473 <a id="id-1.6.6.14.2.2.27.1.3" class="indexterm"></a>
474 </span> <a href="#GUC-RESTRICT-NONSYSTEM-RELATION-KIND" class="id_link">#</a></dt><dd><p>
475 Set relation kinds for which access to non-system relations is prohibited.
476 The value takes the form of a comma-separated list of relation kinds.
477 Currently, the supported relation kinds are <code class="literal">view</code> and
478 <code class="literal">foreign-table</code>.
479 </p></dd></dl></div></div><div class="sect2" id="RUNTIME-CONFIG-CLIENT-FORMAT"><div class="titlepage"><div><div><h3 class="title">19.11.2. Locale and Formatting <a href="#RUNTIME-CONFIG-CLIENT-FORMAT" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="GUC-DATESTYLE"><span class="term"><code class="varname">DateStyle</code> (<code class="type">string</code>)
480 <a id="id-1.6.6.14.3.2.1.1.3" class="indexterm"></a>
481 </span> <a href="#GUC-DATESTYLE" class="id_link">#</a></dt><dd><p>
482 Sets the display format for date and time values, as well as the
483 rules for interpreting ambiguous date input values. For
484 historical reasons, this variable contains two independent
485 components: the output format specification (<code class="literal">ISO</code>,
486 <code class="literal">Postgres</code>, <code class="literal">SQL</code>, or <code class="literal">German</code>)
487 and the input/output specification for year/month/day ordering
488 (<code class="literal">DMY</code>, <code class="literal">MDY</code>, or <code class="literal">YMD</code>). These
489 can be set separately or together. The keywords <code class="literal">Euro</code>
490 and <code class="literal">European</code> are synonyms for <code class="literal">DMY</code>; the
491 keywords <code class="literal">US</code>, <code class="literal">NonEuro</code>, and
492 <code class="literal">NonEuropean</code> are synonyms for <code class="literal">MDY</code>. See
493 <a class="xref" href="datatype-datetime.html" title="8.5. Date/Time Types">Section 8.5</a> for more information. The
494 built-in default is <code class="literal">ISO, MDY</code>, but
495 <span class="application">initdb</span> will initialize the
496 configuration file with a setting that corresponds to the
497 behavior of the chosen <code class="varname">lc_time</code> locale.
498 </p></dd><dt id="GUC-INTERVALSTYLE"><span class="term"><code class="varname">IntervalStyle</code> (<code class="type">enum</code>)
499 <a id="id-1.6.6.14.3.2.2.1.3" class="indexterm"></a>
500 </span> <a href="#GUC-INTERVALSTYLE" class="id_link">#</a></dt><dd><p>
501 Sets the display format for interval values.
502 The value <code class="literal">sql_standard</code> will produce
503 output matching <acronym class="acronym">SQL</acronym> standard interval literals.
504 The value <code class="literal">postgres</code> (which is the default) will produce
505 output matching <span class="productname">PostgreSQL</span> releases prior to 8.4
506 when the <a class="xref" href="runtime-config-client.html#GUC-DATESTYLE">DateStyle</a>
507 parameter was set to <code class="literal">ISO</code>.
508 The value <code class="literal">postgres_verbose</code> will produce output
509 matching <span class="productname">PostgreSQL</span> releases prior to 8.4
510 when the <code class="varname">DateStyle</code>
511 parameter was set to non-<code class="literal">ISO</code> output.
512 The value <code class="literal">iso_8601</code> will produce output matching the time
513 interval <span class="quote">“<span class="quote">format with designators</span>”</span> defined in section
516 The <code class="varname">IntervalStyle</code> parameter also affects the
517 interpretation of ambiguous interval input. See
518 <a class="xref" href="datatype-datetime.html#DATATYPE-INTERVAL-INPUT" title="8.5.4. Interval Input">Section 8.5.4</a> for more information.
519 </p></dd><dt id="GUC-TIMEZONE"><span class="term"><code class="varname">TimeZone</code> (<code class="type">string</code>)
520 <a id="id-1.6.6.14.3.2.3.1.3" class="indexterm"></a>
521 <a id="id-1.6.6.14.3.2.3.1.4" class="indexterm"></a>
522 </span> <a href="#GUC-TIMEZONE" class="id_link">#</a></dt><dd><p>
523 Sets the time zone for displaying and interpreting time stamps.
524 The built-in default is <code class="literal">GMT</code>, but that is typically
525 overridden in <code class="filename">postgresql.conf</code>; <span class="application">initdb</span>
526 will install a setting there corresponding to its system environment.
527 See <a class="xref" href="datatype-datetime.html#DATATYPE-TIMEZONES" title="8.5.3. Time Zones">Section 8.5.3</a> for more information.
528 </p></dd><dt id="GUC-TIMEZONE-ABBREVIATIONS"><span class="term"><code class="varname">timezone_abbreviations</code> (<code class="type">string</code>)
529 <a id="id-1.6.6.14.3.2.4.1.3" class="indexterm"></a>
530 <a id="id-1.6.6.14.3.2.4.1.4" class="indexterm"></a>
531 </span> <a href="#GUC-TIMEZONE-ABBREVIATIONS" class="id_link">#</a></dt><dd><p>
532 Sets the collection of additional time zone abbreviations that
533 will be accepted by the server for datetime input (beyond any
534 abbreviations defined by the current <code class="varname">TimeZone</code>
535 setting). The default is <code class="literal">'Default'</code>,
536 which is a collection that works in most of the world; there are
537 also <code class="literal">'Australia'</code> and <code class="literal">'India'</code>,
538 and other collections can be defined for a particular installation.
539 See <a class="xref" href="datetime-config-files.html" title="B.4. Date/Time Configuration Files">Section B.4</a> for more information.
540 </p></dd><dt id="GUC-EXTRA-FLOAT-DIGITS"><span class="term"><code class="varname">extra_float_digits</code> (<code class="type">integer</code>)
541 <a id="id-1.6.6.14.3.2.5.1.3" class="indexterm"></a>
542 <a id="id-1.6.6.14.3.2.5.1.4" class="indexterm"></a>
543 <a id="id-1.6.6.14.3.2.5.1.5" class="indexterm"></a>
544 </span> <a href="#GUC-EXTRA-FLOAT-DIGITS" class="id_link">#</a></dt><dd><p>
545 This parameter adjusts the number of digits used for textual output of
546 floating-point values, including <code class="type">float4</code>, <code class="type">float8</code>,
547 and geometric data types.
549 If the value is 1 (the default) or above, float values are output in
550 shortest-precise format; see <a class="xref" href="datatype-numeric.html#DATATYPE-FLOAT" title="8.1.3. Floating-Point Types">Section 8.1.3</a>. The
551 actual number of digits generated depends only on the value being
552 output, not on the value of this parameter. At most 17 digits are
553 required for <code class="type">float8</code> values, and 9 for <code class="type">float4</code>
554 values. This format is both fast and precise, preserving the original
555 binary float value exactly when correctly read. For historical
556 compatibility, values up to 3 are permitted.
558 If the value is zero or negative, then the output is rounded to a
559 given decimal precision. The precision used is the standard number of
560 digits for the type (<code class="literal">FLT_DIG</code>
561 or <code class="literal">DBL_DIG</code> as appropriate) reduced according to the
562 value of this parameter. (For example, specifying -1 will cause
563 <code class="type">float4</code> values to be output rounded to 5 significant
564 digits, and <code class="type">float8</code> values
565 rounded to 14 digits.) This format is slower and does not preserve all
566 the bits of the binary float value, but may be more human-readable.
567 </p><div class="note"><h3 class="title">Note</h3><p>
568 The meaning of this parameter, and its default value, changed
569 in <span class="productname">PostgreSQL</span> 12;
570 see <a class="xref" href="datatype-numeric.html#DATATYPE-FLOAT" title="8.1.3. Floating-Point Types">Section 8.1.3</a> for further discussion.
571 </p></div></dd><dt id="GUC-CLIENT-ENCODING"><span class="term"><code class="varname">client_encoding</code> (<code class="type">string</code>)
572 <a id="id-1.6.6.14.3.2.6.1.3" class="indexterm"></a>
573 <a id="id-1.6.6.14.3.2.6.1.4" class="indexterm"></a>
574 </span> <a href="#GUC-CLIENT-ENCODING" class="id_link">#</a></dt><dd><p>
575 Sets the client-side encoding (character set).
576 The default is to use the database encoding.
577 The character sets supported by the <span class="productname">PostgreSQL</span>
578 server are described in <a class="xref" href="multibyte.html#MULTIBYTE-CHARSET-SUPPORTED" title="23.3.1. Supported Character Sets">Section 23.3.1</a>.
579 </p></dd><dt id="GUC-LC-MESSAGES"><span class="term"><code class="varname">lc_messages</code> (<code class="type">string</code>)
580 <a id="id-1.6.6.14.3.2.7.1.3" class="indexterm"></a>
581 </span> <a href="#GUC-LC-MESSAGES" class="id_link">#</a></dt><dd><p>
582 Sets the language in which messages are displayed. Acceptable
583 values are system-dependent; see <a class="xref" href="locale.html" title="23.1. Locale Support">Section 23.1</a> for
584 more information. If this variable is set to the empty string
585 (which is the default) then the value is inherited from the
586 execution environment of the server in a system-dependent way.
588 On some systems, this locale category does not exist. Setting
589 this variable will still work, but there will be no effect.
590 Also, there is a chance that no translated messages for the
591 desired language exist. In that case you will continue to see
592 the English messages.
594 Only superusers and users with the appropriate <code class="literal">SET</code>
595 privilege can change this setting.
596 </p></dd><dt id="GUC-LC-MONETARY"><span class="term"><code class="varname">lc_monetary</code> (<code class="type">string</code>)
597 <a id="id-1.6.6.14.3.2.8.1.3" class="indexterm"></a>
598 </span> <a href="#GUC-LC-MONETARY" class="id_link">#</a></dt><dd><p>
599 Sets the locale to use for formatting monetary amounts, for
600 example with the <code class="function">to_char</code> family of
601 functions. Acceptable values are system-dependent; see <a class="xref" href="locale.html" title="23.1. Locale Support">Section 23.1</a> for more information. If this variable is
602 set to the empty string (which is the default) then the value
603 is inherited from the execution environment of the server in a
604 system-dependent way.
605 </p></dd><dt id="GUC-LC-NUMERIC"><span class="term"><code class="varname">lc_numeric</code> (<code class="type">string</code>)
606 <a id="id-1.6.6.14.3.2.9.1.3" class="indexterm"></a>
607 </span> <a href="#GUC-LC-NUMERIC" class="id_link">#</a></dt><dd><p>
608 Sets the locale to use for formatting numbers, for example
609 with the <code class="function">to_char</code> family of
610 functions. Acceptable values are system-dependent; see <a class="xref" href="locale.html" title="23.1. Locale Support">Section 23.1</a> for more information. If this variable is
611 set to the empty string (which is the default) then the value
612 is inherited from the execution environment of the server in a
613 system-dependent way.
614 </p></dd><dt id="GUC-LC-TIME"><span class="term"><code class="varname">lc_time</code> (<code class="type">string</code>)
615 <a id="id-1.6.6.14.3.2.10.1.3" class="indexterm"></a>
616 </span> <a href="#GUC-LC-TIME" class="id_link">#</a></dt><dd><p>
617 Sets the locale to use for formatting dates and times, for example
618 with the <code class="function">to_char</code> family of
619 functions. Acceptable values are system-dependent; see <a class="xref" href="locale.html" title="23.1. Locale Support">Section 23.1</a> for more information. If this variable is
620 set to the empty string (which is the default) then the value
621 is inherited from the execution environment of the server in a
622 system-dependent way.
623 </p></dd><dt id="GUC-ICU-VALIDATION-LEVEL"><span class="term"><code class="varname">icu_validation_level</code> (<code class="type">enum</code>)
624 <a id="id-1.6.6.14.3.2.11.1.3" class="indexterm"></a>
625 </span> <a href="#GUC-ICU-VALIDATION-LEVEL" class="id_link">#</a></dt><dd><p>
626 When ICU locale validation problems are encountered, controls which
627 <a class="link" href="runtime-config-logging.html#RUNTIME-CONFIG-SEVERITY-LEVELS" title="Table 19.2. Message Severity Levels">message level</a> is
628 used to report the problem. Valid values are
629 <code class="literal">DISABLED</code>, <code class="literal">DEBUG5</code>,
630 <code class="literal">DEBUG4</code>, <code class="literal">DEBUG3</code>,
631 <code class="literal">DEBUG2</code>, <code class="literal">DEBUG1</code>,
632 <code class="literal">INFO</code>, <code class="literal">NOTICE</code>,
633 <code class="literal">WARNING</code>, <code class="literal">ERROR</code>, and
634 <code class="literal">LOG</code>.
636 If set to <code class="literal">DISABLED</code>, does not report validation
637 problems at all. Otherwise reports problems at the given message
638 level. The default is <code class="literal">WARNING</code>.
639 </p></dd><dt id="GUC-DEFAULT-TEXT-SEARCH-CONFIG"><span class="term"><code class="varname">default_text_search_config</code> (<code class="type">string</code>)
640 <a id="id-1.6.6.14.3.2.12.1.3" class="indexterm"></a>
641 </span> <a href="#GUC-DEFAULT-TEXT-SEARCH-CONFIG" class="id_link">#</a></dt><dd><p>
642 Selects the text search configuration that is used by those variants
643 of the text search functions that do not have an explicit argument
644 specifying the configuration.
645 See <a class="xref" href="textsearch.html" title="Chapter 12. Full Text Search">Chapter 12</a> for further information.
646 The built-in default is <code class="literal">pg_catalog.simple</code>, but
647 <span class="application">initdb</span> will initialize the
648 configuration file with a setting that corresponds to the
649 chosen <code class="varname">lc_ctype</code> locale, if a configuration
650 matching that locale can be identified.
651 </p></dd></dl></div></div><div class="sect2" id="RUNTIME-CONFIG-CLIENT-PRELOAD"><div class="titlepage"><div><div><h3 class="title">19.11.3. Shared Library Preloading <a href="#RUNTIME-CONFIG-CLIENT-PRELOAD" class="id_link">#</a></h3></div></div></div><p>
652 Several settings are available for preloading shared libraries into the
653 server, in order to load additional functionality or achieve performance
654 benefits. For example, a setting of
655 <code class="literal">'$libdir/mylib'</code> would cause
656 <code class="literal">mylib.so</code> (or on some platforms,
657 <code class="literal">mylib.sl</code>) to be preloaded from the installation's standard
658 library directory. The differences between the settings are when they
659 take effect and what privileges are required to change them.
661 <span class="productname">PostgreSQL</span> procedural language libraries can
662 be preloaded in this way, typically by using the
663 syntax <code class="literal">'$libdir/plXXX'</code> where
664 <code class="literal">XXX</code> is <code class="literal">pgsql</code>, <code class="literal">perl</code>,
665 <code class="literal">tcl</code>, or <code class="literal">python</code>.
667 Only shared libraries specifically intended to be used with PostgreSQL
668 can be loaded this way. Every PostgreSQL-supported library has
669 a <span class="quote">“<span class="quote">magic block</span>”</span> that is checked to guarantee compatibility. For
670 this reason, non-PostgreSQL libraries cannot be loaded in this way. You
671 might be able to use operating-system facilities such
672 as <code class="envar">LD_PRELOAD</code> for that.
674 In general, refer to the documentation of a specific module for the
675 recommended way to load that module.
676 </p><div class="variablelist"><dl class="variablelist"><dt id="GUC-LOCAL-PRELOAD-LIBRARIES"><span class="term"><code class="varname">local_preload_libraries</code> (<code class="type">string</code>)
677 <a id="id-1.6.6.14.4.6.1.1.3" class="indexterm"></a>
678 <a id="id-1.6.6.14.4.6.1.1.4" class="indexterm"></a>
679 </span> <a href="#GUC-LOCAL-PRELOAD-LIBRARIES" class="id_link">#</a></dt><dd><p>
680 This variable specifies one or more shared libraries that are to be
681 preloaded at connection start.
682 It contains a comma-separated list of library names, where each name
683 is interpreted as for the <a class="link" href="sql-load.html" title="LOAD"><code class="command">LOAD</code></a> command.
684 Whitespace between entries is ignored; surround a library name with
685 double quotes if you need to include whitespace or commas in the name.
686 The parameter value only takes effect at the start of the connection.
687 Subsequent changes have no effect. If a specified library is not
688 found, the connection attempt will fail.
690 This option can be set by any user. Because of that, the libraries
691 that can be loaded are restricted to those appearing in the
692 <code class="filename">plugins</code> subdirectory of the installation's
693 standard library directory. (It is the database administrator's
694 responsibility to ensure that only <span class="quote">“<span class="quote">safe</span>”</span> libraries
695 are installed there.) Entries in <code class="varname">local_preload_libraries</code>
696 can specify this directory explicitly, for example
697 <code class="literal">$libdir/plugins/mylib</code>, or just specify
698 the library name — <code class="literal">mylib</code> would have
699 the same effect as <code class="literal">$libdir/plugins/mylib</code>.
701 The intent of this feature is to allow unprivileged users to load
702 debugging or performance-measurement libraries into specific sessions
703 without requiring an explicit <code class="command">LOAD</code> command. To that end,
704 it would be typical to set this parameter using
705 the <code class="envar">PGOPTIONS</code> environment variable on the client or by
707 <code class="command">ALTER ROLE SET</code>.
709 However, unless a module is specifically designed to be used in this way by
710 non-superusers, this is usually not the right setting to use. Look
711 at <a class="xref" href="runtime-config-client.html#GUC-SESSION-PRELOAD-LIBRARIES">session_preload_libraries</a> instead.
712 </p></dd><dt id="GUC-SESSION-PRELOAD-LIBRARIES"><span class="term"><code class="varname">session_preload_libraries</code> (<code class="type">string</code>)
713 <a id="id-1.6.6.14.4.6.2.1.3" class="indexterm"></a>
714 </span> <a href="#GUC-SESSION-PRELOAD-LIBRARIES" class="id_link">#</a></dt><dd><p>
715 This variable specifies one or more shared libraries that are to be
716 preloaded at connection start.
717 It contains a comma-separated list of library names, where each name
718 is interpreted as for the <a class="link" href="sql-load.html" title="LOAD"><code class="command">LOAD</code></a> command.
719 Whitespace between entries is ignored; surround a library name with
720 double quotes if you need to include whitespace or commas in the name.
721 The parameter value only takes effect at the start of the connection.
722 Subsequent changes have no effect. If a specified library is not
723 found, the connection attempt will fail.
724 Only superusers and users with the appropriate <code class="literal">SET</code>
725 privilege can change this setting.
727 The intent of this feature is to allow debugging or
728 performance-measurement libraries to be loaded into specific sessions
730 <code class="command">LOAD</code> command being given. For
731 example, <a class="xref" href="auto-explain.html" title="F.3. auto_explain — log execution plans of slow queries">auto_explain</a> could be enabled for all
732 sessions under a given user name by setting this parameter
733 with <code class="command">ALTER ROLE SET</code>. Also, this parameter can be changed
734 without restarting the server (but changes only take effect when a new
735 session is started), so it is easier to add new modules this way, even
736 if they should apply to all sessions.
738 Unlike <a class="xref" href="runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES">shared_preload_libraries</a>, there is no large
739 performance advantage to loading a library at session start rather than
740 when it is first used. There is some advantage, however, when
741 connection pooling is used.
742 </p></dd><dt id="GUC-SHARED-PRELOAD-LIBRARIES"><span class="term"><code class="varname">shared_preload_libraries</code> (<code class="type">string</code>)
743 <a id="id-1.6.6.14.4.6.3.1.3" class="indexterm"></a>
744 </span> <a href="#GUC-SHARED-PRELOAD-LIBRARIES" class="id_link">#</a></dt><dd><p>
745 This variable specifies one or more shared libraries to be preloaded at
747 It contains a comma-separated list of library names, where each name
748 is interpreted as for the <a class="link" href="sql-load.html" title="LOAD"><code class="command">LOAD</code></a> command.
749 Whitespace between entries is ignored; surround a library name with
750 double quotes if you need to include whitespace or commas in the name.
751 This parameter can only be set at server start. If a specified
752 library is not found, the server will fail to start.
754 Some libraries need to perform certain operations that can only take
755 place at postmaster start, such as allocating shared memory, reserving
756 light-weight locks, or starting background workers. Those libraries
757 must be loaded at server start through this parameter. See the
758 documentation of each library for details.
760 Other libraries can also be preloaded. By preloading a shared library,
761 the library startup time is avoided when the library is first used.
762 However, the time to start each new server process might increase
763 slightly, even if that process never uses the library. So this
764 parameter is recommended only for libraries that will be used in most
765 sessions. Also, changing this parameter requires a server restart, so
766 this is not the right setting to use for short-term debugging tasks,
767 say. Use <a class="xref" href="runtime-config-client.html#GUC-SESSION-PRELOAD-LIBRARIES">session_preload_libraries</a> for that
769 </p><div class="note"><h3 class="title">Note</h3><p>
770 On Windows hosts, preloading a library at server start will not reduce
771 the time required to start each new server process; each server process
772 will re-load all preload libraries. However, <code class="varname">shared_preload_libraries
773 </code> is still useful on Windows hosts for libraries that need to
774 perform operations at postmaster start time.
775 </p></div></dd><dt id="GUC-JIT-PROVIDER"><span class="term"><code class="varname">jit_provider</code> (<code class="type">string</code>)
776 <a id="id-1.6.6.14.4.6.4.1.3" class="indexterm"></a>
777 </span> <a href="#GUC-JIT-PROVIDER" class="id_link">#</a></dt><dd><p>
778 This variable is the name of the JIT provider library to be used
779 (see <a class="xref" href="jit-extensibility.html#JIT-PLUGGABLE" title="30.4.2. Pluggable JIT Providers">Section 30.4.2</a>).
780 The default is <code class="literal">llvmjit</code>.
781 This parameter can only be set at server start.
783 If set to a non-existent library, <acronym class="acronym">JIT</acronym> will not be
784 available, but no error will be raised. This allows JIT support to be
785 installed separately from the main
786 <span class="productname">PostgreSQL</span> package.
787 </p></dd></dl></div></div><div class="sect2" id="RUNTIME-CONFIG-CLIENT-OTHER"><div class="titlepage"><div><div><h3 class="title">19.11.4. Other Defaults <a href="#RUNTIME-CONFIG-CLIENT-OTHER" class="id_link">#</a></h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt id="GUC-DYNAMIC-LIBRARY-PATH"><span class="term"><code class="varname">dynamic_library_path</code> (<code class="type">string</code>)
788 <a id="id-1.6.6.14.5.2.1.1.3" class="indexterm"></a>
789 <a id="id-1.6.6.14.5.2.1.1.4" class="indexterm"></a>
790 </span> <a href="#GUC-DYNAMIC-LIBRARY-PATH" class="id_link">#</a></dt><dd><p>
791 If a dynamically loadable module needs to be opened and the
792 file name specified in the <code class="command">CREATE FUNCTION</code> or
793 <code class="command">LOAD</code> command
794 does not have a directory component (i.e., the
795 name does not contain a slash), the system will search this
796 path for the required file.
798 The value for <code class="varname">dynamic_library_path</code> must be a
799 list of absolute directory paths separated by colons (or semi-colons
800 on Windows). If a list element starts
801 with the special string <code class="literal">$libdir</code>, the
802 compiled-in <span class="productname">PostgreSQL</span> package
803 library directory is substituted for <code class="literal">$libdir</code>; this
804 is where the modules provided by the standard
805 <span class="productname">PostgreSQL</span> distribution are installed.
806 (Use <code class="literal">pg_config --pkglibdir</code> to find out the name of
807 this directory.) For example:
808 </p><pre class="programlisting">
809 dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
811 or, in a Windows environment:
812 </p><pre class="programlisting">
813 dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
816 The default value for this parameter is
817 <code class="literal">'$libdir'</code>. If the value is set to an empty
818 string, the automatic path search is turned off.
820 This parameter can be changed at run time by superusers and users
821 with the appropriate <code class="literal">SET</code> privilege, but a
822 setting done that way will only persist until the end of the
823 client connection, so this method should be reserved for
824 development purposes. The recommended way to set this parameter
825 is in the <code class="filename">postgresql.conf</code> configuration
827 </p></dd><dt id="GUC-EXTENSION-CONTROL-PATH"><span class="term"><code class="varname">extension_control_path</code> (<code class="type">string</code>)
828 <a id="id-1.6.6.14.5.2.2.1.3" class="indexterm"></a>
829 </span> <a href="#GUC-EXTENSION-CONTROL-PATH" class="id_link">#</a></dt><dd><p>
830 A path to search for extensions, specifically extension control files
831 (<code class="filename"><em class="replaceable"><code>name</code></em>.control</code>). The
832 remaining extension script and secondary control files are then loaded
833 from the same directory where the primary control file was found.
834 See <a class="xref" href="extend-extensions.html#EXTEND-EXTENSIONS-FILES" title="36.17.1. Extension Files">Section 36.17.1</a> for details.
836 The value for <code class="varname">extension_control_path</code> must be a
837 list of absolute directory paths separated by colons (or semi-colons
838 on Windows). If a list element starts
839 with the special string <code class="literal">$system</code>, the
840 compiled-in <span class="productname">PostgreSQL</span> extension
841 directory is substituted for <code class="literal">$system</code>; this
842 is where the extensions provided by the standard
843 <span class="productname">PostgreSQL</span> distribution are installed.
844 (Use <code class="literal">pg_config --sharedir</code> to find out the name of
845 this directory.) For example:
846 </p><pre class="programlisting">
847 extension_control_path = '/usr/local/share/postgresql:/home/my_project/share:$system'
849 or, in a Windows environment:
850 </p><pre class="programlisting">
851 extension_control_path = 'C:\tools\postgresql;H:\my_project\share;$system'
853 Note that the specified paths elements are expected to have a
854 subdirectory <code class="filename">extension</code> which will contain the
855 <code class="filename">.control</code> and <code class="filename">.sql</code> files; the
856 <code class="filename">extension</code> suffix is automatically appended to
859 The default value for this parameter is
860 <code class="literal">'$system'</code>. If the value is set to an empty
861 string, the default <code class="literal">'$system'</code> is also assumed.
863 If extensions with equal names are present in multiple directories in
864 the configured path, only the instance found first in the path will be
867 This parameter can be changed at run time by superusers and users
868 with the appropriate <code class="literal">SET</code> privilege, but a
869 setting done that way will only persist until the end of the
870 client connection, so this method should be reserved for
871 development purposes. The recommended way to set this parameter
872 is in the <code class="filename">postgresql.conf</code> configuration
875 Note that if you set this parameter to be able to load extensions from
876 nonstandard locations, you will most likely also need to set <a class="xref" href="runtime-config-client.html#GUC-DYNAMIC-LIBRARY-PATH">dynamic_library_path</a> to a correspondent location, for
878 </p><pre class="programlisting">
879 extension_control_path = '/usr/local/share/postgresql:$system'
880 dynamic_library_path = '/usr/local/lib/postgresql:$libdir'
882 </p></dd><dt id="GUC-GIN-FUZZY-SEARCH-LIMIT"><span class="term"><code class="varname">gin_fuzzy_search_limit</code> (<code class="type">integer</code>)
883 <a id="id-1.6.6.14.5.2.3.1.3" class="indexterm"></a>
884 </span> <a href="#GUC-GIN-FUZZY-SEARCH-LIMIT" class="id_link">#</a></dt><dd><p>
885 Soft upper limit of the size of the set returned by GIN index scans. For more
886 information see <a class="xref" href="gin.html#GIN-TIPS" title="65.4.5. GIN Tips and Tricks">Section 65.4.5</a>.
887 </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="runtime-config-vacuum.html" title="19.10. Vacuuming">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="runtime-config.html" title="Chapter 19. Server Configuration">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="runtime-config-locks.html" title="19.12. Lock Management">Next</a></td></tr><tr><td width="40%" align="left" valign="top">19.10. Vacuuming </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 19.12. Lock Management</td></tr></table></div></body></html>