Home icon

PostgreSQL large objects: Best practices for Amazon Aurora and RDS

Database Blog



This article provides best practices for managing PostgreSQL large objects in Amazon Aurora and RDS, including monitoring orphaned objects, safely using vacuumlo, and preparing for major version upgrades.

  • Large objects store binary data up to 4 TB and support partial reads/updates, but orphaned objects accumulate without autovacuum cleanup
  • Monitor large object counts and sizes using system catalog queries to track growth and storage consumption
  • Use vacuumlo in dry-run mode after running pre-flight schema checks to safely identify and remove orphaned objects
  • Vacuumlo has limitations: it only detects oid and lo column types, missing domain types and integer/text columns storing OIDs
  • Set up lo_manage triggers for automatic cleanup when large object references are updated or deleted
  • Monitor OID exhaustion through Performance Insights LWLock:OidGenLock wait events to prevent creation slowdowns
  • Before major version upgrades with high large object counts, run vacuumlo, VACUUM FREEZE, and scale up instance memory

Proper large object management prevents storage waste, OID contention, and upgrade failures by combining monitoring, safe cleanup practices, and preventive triggers.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Jan 27
2026
Strategies for upgrading Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL from version 13
Feb 26
2025
Upgrade strategies for Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL 12
Nov 13
2026
Boosting Amazon RDS for PostgreSQL with AWS Graviton5: Benchmarks
Nov 12
2026
Amazon Aurora and RDS now support Graviton5-based R9g database instances

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.