Error: extension has no installation script nor update path for version
Question
Why does atlas schema apply / atlas schema plan fail with an error like this when working with PostgreSQL extensions?
Error: create extension "postgis_topology": pq: extension "postgis_topology" has no installation script nor update path for version "3.4.3"
Answer
This error occurs when there's a version mismatch between the extension installed in your target database (current state) and the extension available in your local dev-database.
To make sure migration plans are safe, Atlas does the following:
- It first creates the current state (the database schema) on the dev-database
- Applies the planned migration to it
- Inspects the result and checks if it matches the desired target state
This simulation helps Atlas detect potential issues before touching your actual database while ensuring the migration plans actually bring the schema to the desired state.
During stages 1 and 2, Atlas needs to recreate your schema's extensions in the dev-database. If the dev-database doesn't have installation scripts for the exact extension versions (whether from your current schema or desired state), PostgreSQL returns this error.
For example, if your production database has PostGIS 3.4.3 but your dev-database Docker image only includes PostGIS 3.5.x, Atlas cannot create an identical schema in the dev-database for validation.