RepoJournal
Rails

@rails

Ruby on Rails - Shopify, Basecamp, GitHub all run on it

Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

One email a day. Unsubscribe in one click.

Pick a date

Topics: Ruby Full archive →

The Wire · Showcase

POSTGRESQL 18.4 FOREIGN KEY SUPPORT LANDS IN RAILS

By RepoJournal · Filed · About Rails

Rails just shipped native support for PostgreSQL 18.4's NOT ENFORCED foreign keys, letting table owners toggle constraints without superuser privileges for the first time.

The Rails core team merged two complementary features that fundamentally change how you handle foreign key constraints on modern PostgreSQL. First, disable_referential_integrity now uses NOT ENFORCED/ENFORCED syntax on PostgreSQL 18.4+ instead of requiring DISABLE TRIGGER ALL superuser access [1]. Second, a new enforced: option lets you declare foreign keys as NOT ENFORCED directly in migrations, solving the silent data corruption problem where switching back to ENFORCED wouldn't re-validate existing rows [2]. Together, these changes eliminate the superuser requirement that has plagued Rails deployments for years. On the tooling side, Rails also added exclusion_constraint_exists? and unique_constraint_exists? helpers to round out constraint introspection [3]. In other updates, the devcontainer now supports Ruby 4.0.5 [4], and rails/marcel improved MIME type detection with tika.xml regex support while cleaning up trailing spaces in type definitions [5].

One email a day. Unsubscribe in one click.

Action items

References

  1. [1] Use NOT ENFORCED in disable_referential_integrity on PostgreSQL 18.4+ ↗ rails/rails
  2. [2] Add `enforced:` option for foreign keys on PostgreSQL 18.4+ ↗ rails/rails
  3. [3] Add `exclusion_constraint_exists?` and `unique_constraint_exists?` helpers rails/rails
  4. [4] ruby-2.3.3 ↗ rails/devcontainer
  5. [5] add `tika.xml` regex support ↗ rails/marcel

Quick answers

What shipped in Rails on May 20, 2026?
Rails just shipped native support for PostgreSQL 18.4's NOT ENFORCED foreign keys, letting table owners toggle constraints without superuser privileges for the first time. In total, 45 commits, 21 pull requests, and 2 releases landed.
Who contributed to Rails on May 20, 2026?
2 developers shipped this update, including yahonda and alexanderadam.
What were the notable Rails updates?
Use NOT ENFORCED in disable_referential_integrity on PostgreSQL 18.4+, Add `enforced:` option for foreign keys on PostgreSQL 18.4+, and Add `exclusion_constraint_exists?` and `unique_constraint_exists?` helpers.

More from @rails

Daily updates, in your inbox

Follow Rails

Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

One email a day. Unsubscribe in one click. Read a past issue →

Elsewhere on the wire

Want every project, not just this one?