This parameter is normally on.
At a glance
| Property | Value |
|---|---|
| Parameter | check_function_bodies |
| Category | Client Connection Defaults |
| Default | on |
| Value type | boolean (on/off) |
| Change scope | Per-session (SET) |
| Available in | PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12) |
What it does
This parameter is normally on. When set to off, it disables validation of the routine body string during createfunction and createprocedure. Disabling validation avoids side effects of the validation process, in particular preventing false positives due to problems such as forward references. Set this parameter to off before loading functions on behalf of other users; pg_dump does so automatically.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW check_function_bodies; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'check_function_bodies';.
Tuning guidance
This sets a session default (locale, formatting, search path or transaction behaviour) rather than a performance knob. Set it per role or database with ALTER ROLE/DATABASE ... SET so the right default follows the right workload, and prefer setting it explicitly in the application for behaviour the query results depend on.