fix(postgres): support postgres 18 - #18372
Conversation
Bumps the latest postgres container to 18. The postgres 18 images store their data in a major-version-specific subdirectory, so the volume now mounts at /var/lib/postgresql instead of /var/lib/postgresql/data. Postgres 18 reports foreign key RESTRICT violations with SQLSTATE 23001 (restrict_violation) and a "violates RESTRICT setting of foreign key constraint" message, where earlier versions used 23503. Without handling that, those errors surfaced as a plain DatabaseError instead of a ForeignKeyConstraintError. Co-Authored-By: Claude Opus 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe PostgreSQL development service now uses PostGIS 18-3.6. PostgreSQL error formatting now recognizes ChangesPostgreSQL 18 compatibility
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains in the PostgreSQL 18 compatibility changes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I haven't reviewed the code change yet, but shouldn't really break anything. I do want to see if we can improve the detection when we migrate it to TS |
its just drop in and a change in how data is formatted in PG. the surface area is basically unchanged other than locking. support for uuidv7 is just baked in which is nice, and we should make v7 a first-class and default for uuids. but just setting default(sql( |
* origin/main: (66 commits) meta: update dependency @oclif/test to v4.2.0 (sequelize#18394) meta: update actions/setup-node action to v6.5.0 (sequelize#18391) meta: update actions/stale action to v10.4.0 (sequelize#18392) meta: update actions/checkout action to v6.1.0 (sequelize#18390) meta: update dependency zod to ^4.6.5 (sequelize#18386) meta: update mysql docker tag to v8.4.11 (sequelize#18387) meta(sqlite3): fix changeColumn foreign key race condition. (sequelize#18383) meta: update icr.io/db2_community/db2 docker tag to v12.1.5.0 (sequelize#18385) meta: update gvenzl/oracle-free docker tag to v23.26.3 (sequelize#18384) meta: update sequelize AUTHORS (sequelize#18376) meta: update dependency umzug to ^3.8.3 (sequelize#18381) meta: update dependency zod to ^4.6.4 (sequelize#18382) meta: update dependency uuid to ^11.1.1 (sequelize#18380) meta: update dependency typescript to v6.0.3 (sequelize#18378) meta: update dependency typedoc-plugin-missing-exports to v4.1.4 (sequelize#18377) meta: update dependency typedoc to v0.28.20 (sequelize#18375) meta: update dependency tedious to ^19.2.2 (sequelize#18374) fix(postgres): support postgres 18 (sequelize#18372) meta: update dependency @oclif/plugin-help to ^6.3.0 (sequelize#18373) fix(postgres): correct changeColumn for enum arrays and enum defaults (sequelize#18361) ... # Conflicts: # packages/postgres/src/query-generator.js # packages/postgres/src/query-interface.js Co-Authored-By: Claude Sonnet 5 <[email protected]>
Pull Request Checklist
Description of Changes
Split out of #18258, as requested in #18258 (comment).
Bumps the latest postgres container from
postgis/postgis:17-3.5topostgis/postgis:18-3.6. Two things were needed to make that work:1. The volume mount had to move. The postgres 18 Docker images store data in a major-version-specific subdirectory and refuse to start when a volume is mounted at
/var/lib/postgresql/data(see docker-library/postgres#1259):So
dev/postgres/latestnow mounts the volume at/var/lib/postgresql.dev/postgres/oldest(postgres 11) is untouched.Anyone with an existing local
sequelize-postgres-latest-volumeneedsyarn reset-postgres(orbash dev/postgres/latest/reset.sh) once, since the old volume holds a postgres 17 data directory.2.
ForeignKeyConstraintErrorstopped being raised for RESTRICT violations. Postgres 18 reports foreign keyRESTRICTviolations with SQLSTATE23001(restrict_violation) and a different message, where earlier versions used23503:ON DELETE NO ACTIONstill reports23503, so only RESTRICT is affected.formatErrorinpackages/postgres/src/query.jsnow handles both codes and both message shapes, so the constraint name is still extracted and aForeignKeyConstraintErroris thrown.That regression was caught by the existing integration tests — the
can restrict deletes/can restrict updatestests forBelongsTo,BelongsToMany,HasOneandHasMany(8 failures) — which now pass again.Verified locally against
postgis/postgis:18-3.6(PostgreSQL 18.6):yarn test-integration-postgresgoes from 2087 passing / 8 failing to 2095 passing, 0 failing.List of Breaking Changes
None.
🤖 Generated with Claude Code
Summary by CodeRabbit