Interface PostgresChangeEventMetadata

All Superinterfaces:
ChangeEventMetadata

public sealed interface PostgresChangeEventMetadata extends ChangeEventMetadata
PostgreSQL notification metadata identifying the affected table and row keys.

Instances are supplied by the PostgreSQL notification provider.

Keys use exact database column names, including case, rather than Java property names. Values are the textual representation of PostgreSQL JSON scalar values, without surrounding JSON quotes. In particular, numeric identifiers retain their precision. Both maps are immutable and support composite keys. Inserts have no old keys, deletes have no new keys, and updates retain both, including when a primary key changes. Table invalidations have neither.

Since:
5.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the channel on which the notification was published.
    Returns the primary-key values after the change.
    Returns the primary-key values before the change.
    Returns the schema reported by PostgreSQL.
    Returns the unqualified table name reported by PostgreSQL.
  • Method Details

    • channel

      String channel()
      Returns the channel on which the notification was published.
      Returns:
      The exact notification channel name.
    • schema

      String schema()
      Returns the schema reported by PostgreSQL.
      Returns:
      The database schema name, preserving its spelling and case.
    • table

      String table()
      Returns the unqualified table name reported by PostgreSQL.
      Returns:
      The database table name, preserving its spelling and case.
    • oldKeys

      Map<String,String> oldKeys()
      Returns the primary-key values before the change.
      Returns:
      Immutable values indexed by database column name; empty for inserts and table invalidations.
    • newKeys

      Map<String,String> newKeys()
      Returns the primary-key values after the change.
      Returns:
      Immutable values indexed by database column name; empty for deletes and table invalidations.