Rails Daily: Weekly Recap - Database Performance & Optimistic Locking

Rails merged 20 pull requests this week, featuring significant PostgreSQL improvements with RETURNING clause support for virtual columns and comprehensive RETURNING statement implementation across INSERT, UPDATE, and DELETE operations. Critical fixes addressed optimistic locking rollback behavior and strict loading violations.

Duration: PT2M13S

Episode overview

This episode is a short developer briefing from Rails Daily.

It explains recent repository work in plain language.

  • Show: Rails Daily
  • Published: 2026-05-17T10:02:00Z
  • Audio duration: PT2M13S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

Good morning. This is Rails Daily for the week of May 10th through 17th, 2026.

Twenty pull requests merged with thirty additional commits this week.

Starting with database features: PostgreSQL users gained automatic virtual column reloading on updates through the RETURNING clause, eliminating extra database round trips. This builds on broader RETURNING statement support now available for INSERT, UPDATE, and DELETE operations in Arel, enabling queries that modify…

Performance improvements include optimized insert_all operations for tables with serialized columns, skipping unnecessary coder round-trips for Hash and Array values. The team also enhanced expression index syntax, allowing array notation like ["lower(email)", :status] alongside traditional string syntax.

Critical fixes this week addressed optimistic locking behavior. Lock version counters now properly reset after transaction rollbacks, preventing StaleObjectError exceptions on subsequent saves. Strict loading violations were fixed for pluck operations, ensuring consistent enforcement across query methods.

Active Storage received the long-requested attach! method, providing a "bang" variant that raises exceptions on…

Nearby episodes from Rails Daily

  1. PostgreSQL 18 Support and Security Updates
  2. Cache Controls and Documentation Updates
  3. Query Fixes and Documentation Overhaul
  4. ActiveRecord Job Enhancement
  5. Feature Reversals
  6. PostgreSQL RETURNING Clause and Database Performance
  7. Documentation and Code Cleanup
  8. Rendering System Updates and Date Helper Improvements