Lock File Exists — SQLSTATE F0001
! Symptoms Free
The server reports SQLSTATE F0001 (lock_file_exists), a condition in the Configuration File Error class.
- The error is written to the server log and returned to the client carrying
SQLSTATE F0001. - Any driver (libpq, JDBC, psycopg, npgsql, pgx) surfaces this code in its error object so you can branch on it programmatically.
- PL/pgSQL can trap it by name:
EXCEPTION WHEN lock_file_exists THEN.
1 Environment & reproduce Free
Severity: ERROR | PostgreSQL versions: 12, 13, 14, 15, 16, 17
Reproduce with the exact statement and read the full message in the server log (raise log_min_messages / set log_min_error_statement for more context).
? Root cause Free
F0001 belongs to Class F0 — Configuration File Error. In this class, a configuration file is invalid.
The first two characters (F0) identify the error class, so application code can match the whole class via F0000 when the specific code is not needed.
3 Recovery & verify Free
Fix the syntax in postgresql.conf/pg_hba.conf, then reload (SELECT pg_reload_conf();) or restart; the log names the offending line.
Reference: PostgreSQL error codes — Class F0 (Configuration File Error).