Configuration parameter

exit_on_error — PostgreSQL configuration parameter

Category Error Handling

If on, any error will terminate the current session.

At a glance

Property Value
Parameter exit_on_error
Category Error Handling
Default (see documentation)
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

If on, any error will terminate the current session. By default, this is set to off, so that only FATAL errors will terminate the session.

(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 exit_on_error; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'exit_on_error';.

Tuning guidance

This parameter is rarely a performance lever. Leave it at the default unless you have a specific, documented reason to change it, change it on one session or one role/database first, and confirm the effect with pg_settings and your own measurements before rolling it out cluster-wide.

Reference

PostgreSQL documentation — exit_on_error.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters