Resolving pq: out of shared memory error during schema loading
Question
How can I resolve the pq: out of shared memory error that appears while Atlas loads my schema?
How can I resolve the pq: out of shared memory error that appears while Atlas loads my schema?
Is there a way to change which editor opens when I use the --edit flag while creating a migration?
My revisions table lists the following versions:
mysql> SELECT * FROM "atlas_schema_revisions";
+-------------------------+---------+-----+
| version | applied | ... |
+-------------------------+---------+-----+
| .atlas_cloud_identifier | 0 | |
| 20251007053111 | 1 | |
| 20251007051222 | 1 | |
| 20250618084333 | 1 | |
+-------------------------+---------+-----+
However, when I inspect the target database, the schema changes from 20250618084333 were never applied. How can I delete the latest row(s) so the revision history reflects the actual state?
How can I keep a single canonical schema or model and apply it to multiple database drivers (for example, an application Postgres database and a data-lake store) so the two remain in sync?
Given a large database schema, how can I manage schema migration for a single table without affecting the rest of the schema?
How to inspect an external_schema data source (ORM schema) in atlas.hcl to confirm it loaded correctly?
Why does Atlas not detect PostgreSQL event_trigger objects when using --dev-url with search_path=public?
What encoding is used by Atlas for schema files? How do you avoid encoding issues with PowerShell on Windows?
Atlas uses UTF-8 to encode schema files and migration files generated by Atlas. UTF-8 is the default encoding on nearly all system terminals, but on Windows, PowerShell uses UTF-16 by default. This can cause an encoding issue when Atlas loads the schema files generated by the inspect command.
When working with multiple branches and applying hotfixes directly to production, out-of-order migration conflicts may occur if migration files are created with timestamps that don't reflect the actual merge order.
Consider this scenario:
Initial state:
001_initial.sql001_initial.sql002_add_posts.sql004_add_index.sqlAfter hotfix applied directly to production:
001_initial.sql003_hotfix_add_email.sql ← hotfix added001_initial.sql002_add_posts.sql004_add_index.sql
After merging master into dev - the problem:
001_initial.sql - Applied to production002_add_posts.sql - Dev-only, not applied to production003_hotfix_add_email.sql - Applied to production004_add_index.sql - Dev-only, not applied to productionThis creates a non-linear migration history where migration files 002 and 004 were created before and after the hotfix timestamp but haven't been applied to production.
When using Atlas on my macOS, I can run atlas migrate apply without any issues, and it applies the migrations successfully.
But when running in CI on linux, I get the following error: Error: checksum mismatch
This issue is likely due to differences in line endings between operating systems. macOS uses LF (Line Feed) for line endings,
while Windows uses CRLF (Carriage Return + Line Feed). When you run Atlas commands in a Docker container,
it may be using a different line ending format than what your migrations were created with.