Organizations often operate multiple PostgreSQL databases across development, testing, staging, and production environments. Some databases support customer-facing applications, while others are used for internal reporting, analytics, background jobs, or legacy systems.

Over time, database versions can become outdated without anyone noticing. A team may upgrade its primary production database while leaving older instances running in development environments, reporting systems, or applications maintained by another department.

This becomes a security and maintenance concern when a PostgreSQL major version reaches the end of its support period.

PostgreSQL 14 has reached the end of its community support lifecycle. Its final scheduled support date was November 12, 2026, and PostgreSQL 14.25 is the final minor release. It will no longer receive regular community security and bug fixes.

The challenge for database administrators is not simply upgrading one PostgreSQL server. It is identifying every PostgreSQL 14 instance, understanding which applications depend on it, assessing the upgrade risks, and prioritizing the databases that need attention.

This article explains how to find PostgreSQL 14 databases, inventory instances across environments, identify applications that depend on them, assess upgrade risks, and prepare a practical migration plan.

Why PostgreSQL 14 Databases Need Attention

PostgreSQL follows a major-version support policy under which each major release receives approximately five years of community support.

During the support period, PostgreSQL releases minor updates containing bug fixes, security fixes, and other important corrections.

After a major version reaches end of life, the community stops publishing regular fixes for that version.

This does not mean that an existing PostgreSQL 14 database immediately stops working. Applications can continue connecting to it, executing queries, and processing transactions.

However, continuing to run an unsupported version creates several risks.

Security vulnerabilities may remain unpatched

Security vulnerabilities can be discovered after a PostgreSQL version reaches end of life.

If the affected version no longer receives community security updates, administrators cannot rely on the normal PostgreSQL release process to provide a fix.

This is particularly important for databases that:

  • Accept connections from external applications.

  • Store customer or financial information.

  • Support public-facing services.

  • Are accessible through multiple application environments.

  • Contain sensitive business records.

The risk depends on the vulnerability and the database's exposure, but an unsupported database should be treated as a security-maintenance concern.

Compatibility with newer tools becomes harder

Database drivers, extensions, monitoring tools, backup utilities, and application frameworks evolve over time.

Older PostgreSQL versions may eventually become less compatible with newer software or lose support in managed services and development tools.

This can make future maintenance more difficult.

Operational risks increase

A database upgrade becomes more complicated when the source version is significantly older than the target version.

Administrators may need to review several major-version changes, extension compatibility, deprecated behavior, and migration requirements.

Planning an upgrade before a database becomes several releases behind makes the process easier to manage.

Understanding PostgreSQL 14 Support Status

PostgreSQL's official versioning policy identifies the supported major versions and their expected final release dates.

The support status of PostgreSQL 14 is particularly important when deciding which databases to prioritize.

PostgreSQL version

Support status

Final scheduled support date

PostgreSQL 18

Supported

November 14, 2030

PostgreSQL 17

Supported

November 8, 2029

PostgreSQL 16

Supported

November 9, 2028

PostgreSQL 15

Supported

November 11, 2027

PostgreSQL 14

End of life

November 12, 2026

PostgreSQL 14.25 is the final minor release in the PostgreSQL 14 series.

An organization should not confuse the latest minor version with a supported major version. PostgreSQL 14.25 contains the final scheduled maintenance updates for PostgreSQL 14, but installing it does not extend the version's community support lifecycle.

For databases that must remain on PostgreSQL 14 temporarily, verify that the instance is running the latest available minor release. This is a temporary risk-reduction measure, not a replacement for upgrading.

How to Find PostgreSQL 14 Databases

The first step is to identify every database server running PostgreSQL 14.

In a small environment, an administrator may know where the database servers are installed. In a larger organization, instances can exist across several infrastructure platforms.

For example:

SQL
Organization
    |
    +-- Production
    |     |
    |     +-- Customer API Database
    |     +-- Payment Database
    |     +-- Reporting Database
    |
    +-- Staging
    |     |
    |     +-- Customer API Staging
    |     +-- Payment Staging
    |
    +-- Development
          |
          +-- Developer Database
          +-- Integration Test Database

Do not limit the investigation to production. A development database may contain an old schema or application dependency that becomes important during migration testing.

Check the PostgreSQL server version

If you can connect to a PostgreSQL instance, use the following SQL statement:

Code
SELECT version();

Example output:

Code
PostgreSQL 14.25 on x86_64-pc-linux-gnu,
compiled by gcc, 64-bit

This confirms the PostgreSQL server version.

For a shorter and easier-to-process result, use:

Code
SHOW server_version;

Or:

Code
SELECT current_setting('server_version');

The result can be used by scripts and monitoring tools to identify PostgreSQL 14 instances.

Identify the server version and database name together

When connected to an instance, retrieve its version and database information:

Code
SELECT
    current_database() AS database_name,
    current_setting('server_version') AS server_version,
    current_setting('server_version_num') AS server_version_num;

The server_version_num setting provides a numeric representation of the version.

For PostgreSQL 14, the major-version number begins with 14.

For example, a version such as 14.25 is represented by a numeric value beginning with 1400.

You can use this information in inventory scripts to classify database instances.

Check the PostgreSQL version from the command line

If you have access to the database server or a machine with PostgreSQL client tools, use:

Code
psql --version

Example:

Code
psql (PostgreSQL) 14.25

However, there is an important distinction: this command reports the installed client version, not necessarily the version of the remote PostgreSQL server.

To inspect the server version through a connection:

Code
psql \
  -h database-host \
  -U postgres \
  -d postgres \
  -c "SHOW server_version;"

This distinction matters when multiple PostgreSQL client versions are installed on the same machine.

Finding PostgreSQL 14 Instances Across Multiple Servers

For larger environments, manually connecting to every database is inefficient.

A database inventory script can connect to known PostgreSQL endpoints and collect their server versions.

For example, the following Python script checks a list of database instances.

Install the PostgreSQL Python driver:

Code
pip install "psycopg[binary]"

Create a file named database_inventory.py:

Python
import psycopg

databases = [
    {
        "name": "Production",
        "host": "prod-db.example.com",
        "port": 5432,
        "database": "postgres"
    },
    {
        "name": "Staging",
        "host": "staging-db.example.com",
        "port": 5432,
        "database": "postgres"
    },
    {
        "name": "Development",
        "host": "dev-db.example.com",
        "port": 5432,
        "database": "postgres"
    }
]

for db in databases:
    try:
        with psycopg.connect(
            host=db["host"],
            port=db["port"],
            dbname=db["database"],
            user="inventory_user",
            password="YOUR_SECRET_SOURCE",
            connect_timeout=5
        ) as connection:

            with connection.cursor() as cursor:
                cursor.execute("""
                    SELECT
                        current_setting('server_version'),
                        current_setting('server_version_num')
                """)

                version, version_num = cursor.fetchone()

                major_version = int(version_num) // 10000

                status = (
                    "Upgrade required"
                    if major_version == 14
                    else "Review support status"
                )

                print(
                    db["name"],
                    version,
                    status
                )

    except Exception as error:
        print(
            db["name"],
            "Connection failed:",
            str(error)
        )

The example uses a placeholder for the password source. In a production implementation, retrieve credentials from a secure secret manager rather than hardcoding them.

Also, a failed connection does not mean the server is not running PostgreSQL 14. It means the inventory process could not verify its version.

Possible causes include:

  • Incorrect credentials.

  • Network restrictions.

  • Firewall rules.

  • Database availability issues.

  • Missing connection permissions.

  • Incorrect host or port information.

Record these failures separately so that unverified instances are not mistakenly excluded from the inventory.

Use a central inventory instead of relying on manual lists

A production inventory should contain more than the database version.

For example:

Field

Purpose

Instance name

Identifies the PostgreSQL server

Host or endpoint

Identifies where it runs

Environment

Production, staging, development

PostgreSQL version

Identifies the major and minor release

Database names

Identifies databases hosted by the instance

Application owner

Establishes responsibility

Business criticality

Helps prioritize upgrades

Extension list

Identifies compatibility requirements

Backup status

Confirms recovery readiness

Upgrade status

Tracks migration progress

This inventory becomes the foundation for the upgrade project.

Find PostgreSQL 14 Databases in Cloud Environments

Not every PostgreSQL database is installed on a server that your team manages directly.

Organizations often use managed database services.

Examples include:

  • Amazon RDS for PostgreSQL.

  • Amazon Aurora PostgreSQL-Compatible Edition.

  • Azure Database for PostgreSQL.

  • Google Cloud SQL for PostgreSQL.

  • Self-managed PostgreSQL instances running on virtual machines or containers.

The discovery process depends on the platform.

Amazon RDS

For Amazon RDS, AWS CLI can list PostgreSQL database instances.

CSS
aws rds describe-db-instances \
  --query "DBInstances[?Engine=='postgres'].[DBInstanceIdentifier,EngineVersion,DBInstanceStatus]" \
  --output table

This helps identify PostgreSQL instances and their engine versions.

For Aurora PostgreSQL, inspect the relevant database clusters separately because Aurora cluster information and instance information are managed through different AWS resources.

Do not assume that every PostgreSQL-compatible database uses the same upgrade path as a standard PostgreSQL installation.

Azure Database for PostgreSQL

For Azure Database for PostgreSQL Flexible Server, Azure CLI can list server information.

Code
az postgres flexible-server list \
  --query "[].{Name:name,Version:version,State:state,Location:location}" \
  --output table

This provides a starting point for identifying older database versions.

Verify the actual service configuration and supported upgrade paths for each server.

Google Cloud SQL

For Cloud SQL PostgreSQL instances:

Code
gcloud sql instances list \
  --format="table(name,databaseVersion,state,region)"

The databaseVersion field helps identify the PostgreSQL major version.

Managed database providers have their own maintenance schedules, supported upgrade paths, and operational constraints. Review the provider's documentation before selecting a migration method.

Identify Which Applications Depend on PostgreSQL 14

Finding a PostgreSQL 14 server is only the first part of the investigation.

The next question is more important:

Which applications depend on this database?

An organization may have a PostgreSQL 14 instance that hosts several databases used by different services.

For example:

SQL
PostgreSQL 14 Server
    |
    +-- customer_db
    |       |
    |       +-- Customer API
    |
    +-- payment_db
    |       |
    |       +-- Payment Service
    |
    +-- reporting_db
            |
            +-- Reporting Application

Upgrading the server affects all databases and applications hosted on that instance.

Before planning the migration, identify:

  • Application connection strings.

  • Database users and roles.

  • Background jobs.

  • Reporting tools.

  • ETL pipelines.

  • External integrations.

  • Monitoring services.

  • Replication consumers.

  • Backup and recovery processes.

Inspect active database connections

PostgreSQL provides the pg_stat_activity system view for monitoring current sessions.

For example:

VB.NET
SELECT
    datname AS database_name,
    usename AS database_user,
    application_name,
    client_addr,
    state,
    COUNT(*) AS connection_count
FROM pg_stat_activity
WHERE datname IS NOT NULL
GROUP BY
    datname,
    usename,
    application_name,
    client_addr,
    state
ORDER BY connection_count DESC;

This query helps identify applications and clients currently connected to the instance.

The application_name value is particularly useful when applications set it in their connection strings.

For example, an application might use:

Code
Application Name=CustomerAPI

A database connection inventory becomes much easier to understand when every service uses a meaningful application name.

However, pg_stat_activity only shows current sessions. It does not identify applications that connect occasionally, use scheduled jobs, or are currently offline.

Combine connection monitoring with application configuration, deployment files, infrastructure definitions, and service ownership records.

Check Database Extensions Before Planning an Upgrade

PostgreSQL applications frequently depend on extensions that provide additional database functionality.

For example:

Code
SELECT
    extname,
    extversion
FROM pg_extension
ORDER BY extname;

This query lists the extensions installed in the current database.

Common extensions include:

Extension

Typical purpose

pg_stat_statements

Query execution statistics

pg_trgm

Trigram-based similarity and search

PostGIS

Geographic and spatial data

uuid-ossp

UUID generation

pgcrypto

Cryptographic functions

fuzzystrmatch

Approximate string matching

Not every extension has the same compatibility requirements.

Some extensions are included with PostgreSQL, while others require separate packages or provider-specific support.

Before upgrading PostgreSQL 14, verify that the required extension versions are available for the target PostgreSQL release.

Also inspect custom modules and procedural languages because they may require recompilation or additional migration steps.

Assess the Risk of Each PostgreSQL 14 Instance

Not every PostgreSQL 14 database needs to be upgraded with the same urgency.

A production database containing customer information has a different risk profile from a temporary development database.

Use a risk-based classification.

Database type

Example

Priority

Internet-facing production

Customer-facing API

Critical

Financial production

Payments and transactions

Critical

Internal production

Reporting and business operations

High

Staging

Pre-production testing

High

Development

Developer environments

Medium

Temporary test

Short-lived testing database

Review and retire if unnecessary

Abandoned instance

No known application owner

Investigate and decommission if appropriate

This classification should consider more than the environment name.

A staging database may contain production-like data or be directly accessible from external systems. A development database may be used by a critical integration test pipeline.

Evaluate the actual business impact and exposure.

Create an upgrade priority score

You can introduce a simple scoring model to prioritize instances.

For example:

Risk factor

Score

Publicly accessible production database

5

Sensitive or financial data

5

Critical business application

5

External application dependencies

3

No verified backup

5

No identified owner

3

Development-only environment

1

These scores are illustrative. An organization should define its own risk model and avoid treating the total as a substitute for security assessment.

The purpose is to make upgrade decisions more transparent.

Choose the Appropriate PostgreSQL Upgrade Target

After identifying PostgreSQL 14 databases, select a supported target version.

PostgreSQL 18, 17, 16, and 15 are supported according to the official versioning policy.

The choice should depend on application compatibility, extension availability, managed-service support, and the organization's maintenance strategy.

For example:

Target version

Considerations

PostgreSQL 18

Newer major version with a longer remaining support period

PostgreSQL 17

Mature option with an established ecosystem

PostgreSQL 16

Useful where application and extension compatibility require it

PostgreSQL 15

Possible intermediate target, but has a shorter remaining support period

Do not choose a target solely because it is the newest version.

Review:

  • Application framework compatibility.

  • PostgreSQL driver compatibility.

  • Extension availability.

  • Database migration requirements.

  • Operational support from the hosting provider.

  • Monitoring and backup tooling.

  • Performance behavior.

For many organizations, moving directly to a recent supported major version may be appropriate. However, the correct choice depends on the actual application and infrastructure constraints.

Select a Migration Strategy

Once the target version is selected, choose the migration method.

PostgreSQL provides several approaches for major-version upgrades.

Using pg_upgrade

The pg_upgrade utility upgrades an existing PostgreSQL cluster to a newer major version without requiring the full logical dump-and-restore process.

It creates the new system catalogs and reuses the existing user data files through supported upgrade methods.

A typical command structure looks like this:

Bash
pg_upgrade \
  --old-datadir=/var/lib/postgresql/14/main \
  --new-datadir=/var/lib/postgresql/18/main \
  --old-bindir=/usr/lib/postgresql/14/bin \
  --new-bindir=/usr/lib/postgresql/18/bin \
  --check

The --check option verifies whether the clusters are compatible without performing the actual upgrade.

The paths are examples and must be adjusted for the operating system and installation.

Before using pg_upgrade:

  • Install compatible target-version binaries.

  • Initialize the new PostgreSQL cluster.

  • Install required extension binaries.

  • Review locale and encoding compatibility.

  • Check tablespaces and configuration.

  • Ensure the source and target clusters are compatible.

  • Review the generated reports and required post-upgrade actions.

The --check option is an important preparation step, but it does not replace a complete rehearsal using a copy of production data.

Using pg_dump and pg_restore

A logical migration can be performed using pg_dump and pg_restore.

Create a backup:

Code
pg_dump \
  -h source-host \
  -U postgres \
  -d application_db \
  -Fc \
  -f application.dump

Restore it into the target database:

Code
pg_restore \
  -h target-host \
  -U postgres \
  -d application_db \
  --verbose \
  application.dump

This approach can be useful when teams want to validate schema and data restoration independently.

However, dump-and-restore duration depends on database size, indexes, constraints, and available resources.

For large databases with strict downtime requirements, evaluate whether this method meets the migration window.

Using logical replication

Logical replication can help reduce downtime for certain migration scenarios.

A typical approach involves:

  1. Creating the target PostgreSQL environment.

  2. Configuring logical replication.

  3. Copying the initial data.

  4. Replicating ongoing changes.

  5. Verifying replication progress.

  6. Performing a controlled cutover.

  7. Redirecting applications to the target.

Logical replication requires careful planning around schema changes, sequences, unsupported objects, and replication limitations.

It is not a complete automatic replacement for every migration step.

Validate the Upgrade Before Production Cutover

A successful database upgrade is not just one where PostgreSQL starts successfully.

The application must also behave correctly against the new version.

Create a staging environment using a representative copy of production data and run the application's integration and regression tests.

Validate the following areas:

Validation area

What to verify

Database connectivity

Applications can connect successfully

Schema

Tables, views, indexes, and constraints are present

Data integrity

Important records and relationships are preserved

Stored procedures

Functions execute correctly

Extensions

Required extensions are available and compatible

Query performance

Critical queries meet expected performance

Transactions

Commit and rollback behavior is correct

Replication

Required replication processes work

Backup and restore

Recovery procedures are tested

Monitoring

Alerts and dashboards report the new instance correctly

Also compare important execution plans before and after the upgrade.

Use:

Code
EXPLAIN (ANALYZE, BUFFERS)
SELECT *
FROM orders
WHERE customer_id = 1001;

This helps identify queries that may need additional investigation.

For write operations, remember that EXPLAIN ANALYZE executes the statement. Use isolated test data and appropriate transaction controls.

Build a Central PostgreSQL 14 Upgrade Inventory

For an organization managing multiple database instances, create a central tracking sheet.

For example:

Instance

Environment

Version

Application owner

Risk

Upgrade status

customer-db

Production

14.25

Customer team

Critical

Planned

payment-db

Production

14.24

Payments team

Critical

Assessment

reporting-db

Production

14.25

Data team

High

Testing

staging-db

Staging

14.25

Platform team

High

In progress

dev-db

Development

14.20

Engineering

Medium

Pending

The table should be updated as the upgrade progresses.

Additional fields can include:

  • Database size.

  • Backup location.

  • Extension inventory.

  • Target PostgreSQL version.

  • Migration strategy.

  • Maintenance window.

  • Rollback plan.

  • Application validation status.

  • Responsible DBA.

  • Planned completion date.

This helps management and engineering teams understand which databases remain exposed to unsupported-version risks.

Common Mistakes When Finding PostgreSQL 14 Databases

Mistake

Why it causes problems

Better approach

Checking only production servers

Older instances may remain in staging or development

Inventory every environment

Using psql --version as the server version

It reports the client version

Query the connected server

Checking only database names

Multiple databases can run on one PostgreSQL instance

Inventory server instances and hosted databases

Ignoring managed cloud databases

Cloud instances may be managed by another team

Include cloud account and subscription inventories

Assuming no connections means no usage

Scheduled jobs may connect occasionally

Review application configuration and job schedules

Ignoring extensions

Required modules may not support the target version

Inventory and validate extensions

Upgrading without a restore test

A backup may be unusable or incomplete

Rehearse recovery

Choosing a target only by version number

Application and provider compatibility may differ

Validate the complete technology stack

PostgreSQL 14 Upgrade Checklist

Use this checklist to organize the database discovery and migration process.

  • Identify all PostgreSQL servers across production and non-production environments.

  • Verify server versions using SQL rather than client-version commands.

  • Identify every database hosted by PostgreSQL 14 instances.

  • Inventory managed cloud database services.

  • Identify applications and scheduled jobs using each instance.

  • Review active connections and application names.

  • Inventory installed extensions and custom modules.

  • Identify database owners and business criticality.

  • Verify backup and recovery procedures.

  • Select an appropriate supported target version.

  • Choose a migration strategy.

  • Run pg_upgrade compatibility checks or test logical migration.

  • Restore representative data in a staging environment.

  • Run application regression and performance tests.

  • Prepare the production maintenance and cutover plan.

  • Document rollback and recovery procedures.

  • Verify monitoring after migration.

  • Confirm that no unplanned PostgreSQL 14 dependencies remain.

Conclusion

Finding PostgreSQL 14 databases is the first step toward managing the risks associated with an unsupported database version.

The process should cover every environment, including production, staging, development, cloud-hosted instances, and databases managed by other teams.

Start by querying the actual server version, building a central inventory, and identifying the applications that depend on each instance. Then review extensions, data sensitivity, business criticality, and available migration options.

PostgreSQL 14 has reached the end of its community support lifecycle, so organizations should treat remaining instances as upgrade priorities rather than assuming that the databases are safe because they continue to run.

A successful upgrade program is built on accurate discovery, application ownership, tested backups, compatible extensions, and a rehearsed migration strategy. These steps help teams move to a supported PostgreSQL version without introducing unnecessary downtime or application disruption.