PostgreSQL rejects configuration parameters with unrecognized or unsupported values during startup or connection. This typically affects locale, timezone, or text search settings.
Fixes Invalid value for parameter
# Check server log (Docker)
docker logs <container_name>
# Check server log (standard)
tail -f /var/log/postgresql/postgresql.log# Check server log (Docker)docker logs <container_name># Check server log (standard)tail -f /var/log/postgresql/postgresql.logInvalid value for parameter
PostgreSQL validates all configuration parameters against allowed values when loading settings from postgresql.conf or connection startup packets. When a parameter receives a value PostgreSQL cannot recognize or support in your environment, the server raises this fatal error and refuses to start or complete the connection. Common affected parameters include locale settings (lc_messages, lc_monetary), timezones, and text search configurations. The error prevents database access until the invalid parameter is corrected.
Review the PostgreSQL error message carefully to identify which parameter is invalid.
# Check server log (Docker)
docker logs <container_name>
# Check server log (standard)
tail -f /var/log/postgresql/postgresql.logNote the parameter name (e.g., lc_messages, TimeZone) and the rejected value.
If the error involves lc_messages, lc_monetary, lc_numeric, or lc_time:
# List all available locales on your system
locale -a
# Check if en_US.UTF-8 is available (common fix)
locale -a | grep en_US
# On Ubuntu/Debian, install missing locales
sudo locale-gen en_US.UTF-8
sudo update-localeIf the required locale is not available, either install it on your system or change the parameter value to "C" (always available).
Edit postgresql.conf and use only valid locale values:
# Find postgresql.conf
sudo find / -name postgresql.conf
# Edit the file
sudo nano /path/to/postgresql.confReplace invalid locale values with valid ones:
# WRONG: non-existent locale
lc_messages = en_US.utf8
# RIGHT: use C (always available) or installed locale
lc_messages = C
# OR
lc_messages = en_US.UTF-8 # if installed
# Apply to all locale parameters
lc_monetary = C
lc_numeric = C
lc_time = CSave and restart PostgreSQL.
For timezone errors, use only IANA timezone names (not abbreviations):
# WRONG: abbreviation not valid
TimeZone = PST # Fails
TimeZone = CDT # Fails
# RIGHT: use IANA timezone database
TimeZone = America/Los_Angeles
TimeZone = America/Chicago
TimeZone = UTCValid timezone values are located in your PostgreSQL timezone database:
# View all valid timezones
psql -d postgres -c "SELECT * FROM pg_timezone_names ORDER BY name;"Use one of these exact values in postgresql.conf or connection strings.
If the error mentions default_text_search_config:
psql -d postgres -c "SELECT * FROM pg_ts_config;"Ensure the configured value exists. If referencing a schema, verify both schema and configuration exist:
# WRONG: references non-existent schema.config
default_text_search_config = public.pg_config
# RIGHT: use built-in or verify custom config exists
default_text_search_config = english
default_text_search_config = simpleBuilt-in configurations like "english" and "simple" are always available.
After editing postgresql.conf, restart the PostgreSQL service:
# Docker
docker restart <container_name>
# Standard Linux service
sudo systemctl restart postgresql
# Or via sudo
sudo pg_ctlcluster 14 main restartVerify the service started successfully:
sudo systemctl status postgresqlCheck logs for any remaining parameter errors.
For Docker/container deployments, ensure the base image includes required locales. Alpine-based PostgreSQL images often lack locale data; use debian-based images or manually install locale packages. For upgraded systems, compare old and new postgresql.conf.sample to see if removed or changed parameters are causing issues. Parameter values are case-sensitive for most types (especially enum parameters like log_statement); check PostgreSQL documentation for specific parameter capitalization rules. Use pg_settings view to inspect runtime parameter values and their allowed ranges: SELECT name, setting, min_val, max_val, enumvals FROM pg_settings WHERE name = 'parameter_name';