Skip to content

Commit 338daaf

Browse files
committed
Document security implications of check_function_bodies.
Back-patch to 8.4 (all supported versions).
1 parent 23b5a85 commit 338daaf

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

doc/src/sgml/config.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4657,9 +4657,11 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
46574657
<para>
46584658
This parameter is normally on. When set to <literal>off</>, it
46594659
disables validation of the function body string during <xref
4660-
linkend="sql-createfunction">. Disabling validation is
4661-
occasionally useful to avoid problems such as forward references
4662-
when restoring function definitions from a dump.
4660+
linkend="sql-createfunction">. Disabling validation avoids side
4661+
effects of the validation process and avoids false positives due
4662+
to problems such as forward references. Set this parameter
4663+
to <literal>off</> before loading functions on behalf of other
4664+
users; <application>pg_dump</> does so automatically.
46634665
</para>
46644666
</listitem>
46654667
</varlistentry>

doc/src/sgml/plhandler.sgml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,13 @@ CREATE LANGUAGE plsample
195195
<para>
196196
Validator functions should typically honor the <xref
197197
linkend="guc-check-function-bodies"> parameter: if it is turned off then
198-
any expensive or context-sensitive checking should be skipped.
199-
In particular, this parameter is turned off by <application>pg_dump</>
200-
so that it can load procedural language functions without worrying
201-
about possible dependencies of the function bodies on other database
202-
objects. (Because of this requirement, the call handler should avoid
198+
any expensive or context-sensitive checking should be skipped. If the
199+
language provides for code execution at compilation time, the validator
200+
must suppress checks that would induce such execution. In particular,
201+
this parameter is turned off by <application>pg_dump</> so that it can
202+
load procedural language functions without worrying about side effects or
203+
dependencies of the function bodies on other database objects.
204+
(Because of this requirement, the call handler should avoid
203205
assuming that the validator has fully checked the function. The point
204206
of having a validator is not to let the call handler omit checks, but
205207
to notify the user immediately if there are obvious errors in a

0 commit comments

Comments
 (0)