RepoJournal
Rails

@rails

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

Pick a date

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].

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

FAQ

What changed 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.
What should Rails teams do about it?
If you're on PostgreSQL 18.4+, test the new enforced: option in your next feature branch • Update your devcontainer to ruby-2.3.3 when testing local environments
Which Rails repositories shipped on May 20, 2026?
rails/rails, rails/devcontainer, rails/marcel

For your repos

The showcase is a teaser.
Your wire is the product.

Same engine. Different stack. Below: what changes when the wire is yours.

Showcase wire

  • 14 famous open source orgs
  • One wire per day
  • Public, generic
  • Read on the web, when you remember

Your wire

  • Up to 1,500 of your repos - orgs, deps, vendors
  • Morning and evening briefs
  • Action items routed to your team
  • Slack delivery, email, breaking-news CVE alerts

Want a hands-on demo first? Ask a current user for an invite link.