How to fix 01P01: deprecated_feature in PostgreSQL

PostgreSQLINTERMEDIATELOWUpdated Dec 22, 2025· 101 views

This warning indicates your code uses a deprecated PostgreSQL feature. Update to the recommended modern alternative to ensure compatibility with future versions.

Quick fix

Fixes 01P01: deprecated_feature

# View recent PostgreSQL logs
sudo tail -n 100 /var/log/postgresql/postgresql-*.log | grep "01P01\|deprecated"
  1. Identify which specific feature is deprecated
  2. Consult the PostgreSQL documentation for alternatives
  3. Migrate to the recommended alternative
  4. Test the new configuration
postgresql — error
# View recent PostgreSQL logs
sudo tail -n 100 /var/log/postgresql/postgresql-*.log | grep "01P01\|deprecated"
01P01: deprecated_feature

What this error means

The 01P01 error code is a warning (not a failure) that PostgreSQL emits when your SQL code, stored procedures, or configuration uses a feature that has been marked as deprecated. PostgreSQL deprecates features that have been superseded by better alternatives or are considered insecure by modern standards. This is a proactive warning to help you identify code that will eventually stop working in future major PostgreSQL releases. The PostgreSQL Global Development Group typically maintains deprecated features for several major versions before removal, giving you time to migrate. Common deprecated features include MD5 password authentication (deprecated in PostgreSQL 18), certain configuration parameters, and older SQL syntax patterns. The warning belongs to class 01 (warning codes), which means your operation will still succeed, but you should address it to ensure long-term compatibility.

Typical symptoms

  • Warning messages in PostgreSQL logs mentioning "deprecated_feature" or "01P01"
  • Notices displayed when creating or altering database roles with MD5 passwords
  • Deprecation warnings in application logs when connecting to PostgreSQL
  • Client libraries reporting warning-level messages during query execution
  • pg_hba.conf reload warnings about deprecated authentication methods

Common causes

  1. Using MD5 password encryption instead of modern SCRAM-SHA-256 authentication
  2. Referencing configuration parameters that have been renamed or superseded
  3. Using obsolete SQL syntax that has modern alternatives
  4. Relying on features explicitly marked for removal in PostgreSQL release notes
  5. Client applications using deprecated API calls or connection methods

How to fix "01P01: deprecated_feature"

1Identify which specific feature is deprecated

Check your PostgreSQL logs to see the full warning message:

bash
# View recent PostgreSQL logs
sudo tail -n 100 /var/log/postgresql/postgresql-*.log | grep "01P01\|deprecated"

The warning message will specify which feature triggered it. Common examples:
- "MD5 password support is deprecated"
- "Configuration parameter 'X' has been deprecated"

You can also query for MD5 passwords specifically:

sql
-- Find roles still using MD5 passwords
SELECT rolname
FROM pg_authid
WHERE rolcanlogin = true
  AND rolpassword LIKE 'md5%';
2Consult the PostgreSQL documentation for alternatives

Check the official PostgreSQL documentation for your version:

1. Visit the [Deprecated Features wiki page](https://wiki.postgresql.org/wiki/Deprecated_Features)
2. Check the [Obsolete or Renamed Features appendix](https://www.postgresql.org/docs/current/appendix-obsolete.html)
3. Review release notes for your PostgreSQL version

The documentation will indicate:
- Why the feature was deprecated
- What the recommended alternative is
- Timeline for removal (if specified)

3Migrate to the recommended alternative

For MD5 password deprecation (most common case):

sql
-- Update postgresql.conf
-- Set password_encryption = 'scram-sha-256'

-- Then update each user's password
ALTER USER username WITH PASSWORD 'new_password';
-- This will now use SCRAM-SHA-256 automatically

Update pg_hba.conf to use scram-sha-256:

conf
# Change from:
host    all    all    0.0.0.0/0    md5

# To:
host    all    all    0.0.0.0/0    scram-sha-256

Reload PostgreSQL configuration:

bash
sudo systemctl reload postgresql
# Or via SQL:
SELECT pg_reload_conf();
4Test the new configuration

Verify that applications can still connect with the new authentication method:

bash
# Test connection with psql
psql -h localhost -U username -d database_name

# Check for any deprecation warnings
psql -U postgres -c "SHOW password_encryption;"

If using connection poolers (PgBouncer, pgpool), ensure they support SCRAM-SHA-256 authentication. Most modern versions do, but older versions may need updating.

Test all application connections to ensure compatibility:
- Web applications
- Background workers
- Backup scripts
- Monitoring tools

5Update all affected systems

Once you've confirmed the new approach works:

1. Update all environments (dev, staging, production)
2. Update connection strings in application configuration
3. Document the changes for team members
4. Update deployment scripts and infrastructure-as-code

For CI/CD pipelines:

yaml
# GitHub Actions example
- name: Setup PostgreSQL
  run: |
    echo "password_encryption = scram-sha-256" >> postgresql.conf
    psql -c "ALTER USER testuser WITH PASSWORD 'testpass';"

Advanced notes

PL/pgSQL Warning Code Handling

Note that PL/pgSQL does not recognize warning condition names like 'deprecated_feature'. If you're writing error handlers in PL/pgSQL, you must use the numeric code '01P01' instead:

sql
BEGIN
  -- Your code here
EXCEPTION
  WHEN SQLSTATE '01P01' THEN
    RAISE NOTICE 'Deprecated feature used';
END;

This limitation exists because PL/pgSQL's mapping table only collects error codes (classes 03-XX), not warning codes (classes 00-02).

MD5 Removal Timeline

PostgreSQL has announced a phased removal plan for MD5 passwords:
- PostgreSQL 18 (current): Deprecation warnings emitted
- PostgreSQL 19 (expected): MD5 upgrades supported but no new MD5 passwords can be created
- PostgreSQL 20 (expected): MD5 authentication disabled
- PostgreSQL 21 (expected): Cannot upgrade with MD5 passwords

Security Context

MD5 password hashes are vulnerable to pass-the-hash attacks, where an attacker who obtains the hash can authenticate without knowing the actual password. This is why SCRAM-SHA-256 is strongly recommended—it uses challenge-response authentication that doesn't transmit password hashes.

Client Library Compatibility

Before migrating to SCRAM-SHA-256, verify all client libraries support it:
- libpq 10+ (native C library)
- psycopg2 2.8+ (Python)
- pg (node-postgres) 7.12+ (Node.js)
- JDBC 42.2.0+ (Java)
- npgsql 3.2.7+ (.NET)

Older versions may need upgrading before you can switch authentication methods.

Frequently asked questions

What does "01P01: deprecated_feature" mean?
The 01P01 error code is a warning (not a failure) that PostgreSQL emits when your SQL code, stored procedures, or configuration uses a feature that has been marked as deprecated. PostgreSQL deprecates features that have been superseded by better alternatives or are considered insecure by modern standards. This is a proactive warning to help you identify code that will eventually stop working in future major PostgreSQL releases.
How do I fix "01P01: deprecated_feature"?
This warning indicates your code uses a deprecated PostgreSQL feature. Update to the recommended modern alternative to ensure compatibility with future versions.
What causes "01P01: deprecated_feature"?
Using MD5 password encryption instead of modern SCRAM-SHA-256 authentication Referencing configuration parameters that have been renamed or superseded Using obsolete SQL syntax that has modern alternatives
Is the "01P01: deprecated_feature" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading