Databases & Storage

PostgreSQL 19 CommitFest reveals new SQL features and LZ4 compression

Key Takeaway

PostgreSQL 19 introduces 'INSERT ... ON CONFLICT DO SELECT', JSON export support for COPY, and sets LZ4 as the default TOAST compression method.

Summary

The latest updates from the PostgreSQL 19 CommitFest highlight significant improvements to SQL syntax and data handling. Key changes include a new conflict resolution action for INSERT commands, the ability to export data directly to JSON via COPY, and enhanced jsonpath string methods. Additionally, LZ4 is set to become the default compression method for TOAST.

Technical updates in PostgreSQL 19

  • INSERT ... ON CONFLICT DO SELECT: Allows the RETURNING clause to return either a newly inserted row or an existing conflicting row.
  • COPY TO JSON: Adds support for exporting data in JSON format, including a FORCE_ARRAY option.
  • COPY FROM NULL replacement: The ON_ERROR option can now replace invalid data type values with NULL instead of just skipping the row.
  • TOAST Compression: LZ4 is designated as the default compression method.
  • jsonpath: New string methods added: lower(), upper(), initcap(), replace(), split_part(), btrim(), ltrim(), and rtrim().
  • postgres_fdw: Remote transactions now inherit READ ONLY and DEFERRABLE modes.

Why it matters

These updates streamline data ingestion and export workflows while improving performance through more efficient default compression.

Original reference: postgr.es →