Thread

Commits

  1. Rename two columns in pg_stat_subscription_stats.

  1. Rename sync_error_count to tbl_sync_error_count in subscription statistics

    vignesh C <vignesh21@gmail.com> — 2025-11-12T04:23:56Z

    Hi,
    
    This patch proposes renaming a column in the view
    pg_stat_subscription_stats to disambiguate between table sync and
    sequence sync error counts. With the introduction of
    seq_sync_error_count, the existing column name sync_error_count
    becomes ambiguous, it's unclear whether it refers to tables,
    sequences, or both. Renaming it to tbl_sync_error_count makes the
    meaning explicit: it represents errors that occurred during table
    synchronization. This helps users avoid confusion when interpreting
    the view's output. These changes were also suggested by Amit's first
    comment at [1] and Peter's fourth comment at [2].
    Thoughts?
    
    Since an existing column is being renamed, this change should also be
    mentioned in the release notes so that users can update any scripts or
    monitoring queries that reference it.
    
    [1] - https://www.postgresql.org/message-id/CAA4eK1LB7u2KQLRFh6xfTSpEB-8gbpR%3DhqzFOfL9Z1R8rj7Q5g%40mail.gmail.com
    [2] - https://www.postgresql.org/message-id/CAHut%2BPtoLN0bRu7bNiSeF04dQQecoW-EXKMBX%3DHy0uqCvQa8MA%40mail.gmail.com
    
    Regards,
    Vignesh
    
  2. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    shveta malik <shveta.malik@gmail.com> — 2025-11-12T05:04:29Z

    On Wed, Nov 12, 2025 at 9:54 AM vignesh C <vignesh21@gmail.com> wrote:
    >
    > Hi,
    >
    > This patch proposes renaming a column in the view
    > pg_stat_subscription_stats to disambiguate between table sync and
    > sequence sync error counts. With the introduction of
    > seq_sync_error_count, the existing column name sync_error_count
    > becomes ambiguous, it's unclear whether it refers to tables,
    > sequences, or both. Renaming it to tbl_sync_error_count makes the
    > meaning explicit: it represents errors that occurred during table
    > synchronization. This helps users avoid confusion when interpreting
    > the view's output.
    
    +1 on the intent. It will definitely help avoid confusion in the names.
    
    I’m slightly leaning toward using 'table_sync_error_count' instead of
    'tbl_sync_error_count'. The name 'table_sync_error_count' isn’t too
    long and should work fine, while 'tbl_..' feels more like an internal
    variable name. But I would like to see what others prefer here.
    
    thanks
    Shveta
    
    
    
    
  3. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Xuneng Zhou <xunengzhou@gmail.com> — 2025-11-12T07:32:19Z

    Hi,
    
    On Wed, Nov 12, 2025 at 1:04 PM shveta malik <shveta.malik@gmail.com> wrote:
    >
    > On Wed, Nov 12, 2025 at 9:54 AM vignesh C <vignesh21@gmail.com> wrote:
    > >
    > > Hi,
    > >
    > > This patch proposes renaming a column in the view
    > > pg_stat_subscription_stats to disambiguate between table sync and
    > > sequence sync error counts. With the introduction of
    > > seq_sync_error_count, the existing column name sync_error_count
    > > becomes ambiguous, it's unclear whether it refers to tables,
    > > sequences, or both. Renaming it to tbl_sync_error_count makes the
    > > meaning explicit: it represents errors that occurred during table
    > > synchronization. This helps users avoid confusion when interpreting
    > > the view's output.
    
    Thanks for the patch.
    
    > +1 on the intent. It will definitely help avoid confusion in the names.
    >
    > I’m slightly leaning toward using 'table_sync_error_count' instead of
    > 'tbl_sync_error_count'. The name 'table_sync_error_count' isn’t too
    > long and should work fine, while 'tbl_..' feels more like an internal
    > variable name. But I would like to see what others prefer here.
    >
    > thanks
    > Shveta
    >
    >
    
    +1 for using table_sync_error_count as the user-facing column name —
    it’s clearer and consistent with existing catalog naming.
    Do we need to bump CATALOG_VERSION_NO for this update?
    
    -- 
    Best,
    Xuneng
    
    
    
    
  4. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Peter Smith <smithpb2250@gmail.com> — 2025-11-12T23:01:09Z

    On Wed, Nov 12, 2025 at 4:04 PM shveta malik <shveta.malik@gmail.com> wrote:
    >
    > On Wed, Nov 12, 2025 at 9:54 AM vignesh C <vignesh21@gmail.com> wrote:
    > >
    > > Hi,
    > >
    > > This patch proposes renaming a column in the view
    > > pg_stat_subscription_stats to disambiguate between table sync and
    > > sequence sync error counts. With the introduction of
    > > seq_sync_error_count, the existing column name sync_error_count
    > > becomes ambiguous, it's unclear whether it refers to tables,
    > > sequences, or both. Renaming it to tbl_sync_error_count makes the
    > > meaning explicit: it represents errors that occurred during table
    > > synchronization. This helps users avoid confusion when interpreting
    > > the view's output.
    >
    > +1 on the intent. It will definitely help avoid confusion in the names.
    >
    > I’m slightly leaning toward using 'table_sync_error_count' instead of
    > 'tbl_sync_error_count'. The name 'table_sync_error_count' isn’t too
    > long and should work fine, while 'tbl_..' feels more like an internal
    > variable name. But I would like to see what others prefer here.
    >
    
    +1 to use 'table' instead of 'tbl'.
    
    ~~
    
    But, I was thinking about different naming convention. Since the
    proposal will already change the member, then this is probably my last
    chance to propose this slighty different approach, so I'm just putting
    it out there to see what people think.
    
    Background -- there are the following counters:
    1x "apply" error counter
    2x "synchronization" error counters
    7x "conflict" error counters
    
    IMO it would be better for the "synchronization" error counters to
    have a common "sync_" prefix; this is consistent with all the
    "conflict" counters having a "confl_" prefix.
    
    e.g.
    
    CURRENT
    seq_sync_error_count
    sync_error_count
    
    MY SUGGESTION
    sync_seq_error_count
    sync_table_error_count
    
    ~~
    
    Thoughts?
    
    ======
    Kind Regards,
    Peter Smith.
    Fujitsu Australia
    
    
    
    
  5. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Amit Kapila <amit.kapila16@gmail.com> — 2025-11-13T03:42:36Z

    On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    >
    > CURRENT
    > seq_sync_error_count
    > sync_error_count
    >
    > MY SUGGESTION
    > sync_seq_error_count
    > sync_table_error_count
    >
    
    +1. Along with consistency with other column names, it will also make
    it easier for users to group and query all 'sync' related counts
    together.
    
    -- 
    With Regards,
    Amit Kapila.
    
    
    
    
  6. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Chao Li <li.evan.chao@gmail.com> — 2025-11-13T05:18:07Z

    
    > On Nov 13, 2025, at 11:42, Amit Kapila <amit.kapila16@gmail.com> wrote:
    > 
    > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    >> 
    >> CURRENT
    >> seq_sync_error_count
    >> sync_error_count
    >> 
    >> MY SUGGESTION
    >> sync_seq_error_count
    >> sync_table_error_count
    >> 
    > 
    > +1. Along with consistency with other column names, it will also make
    > it easier for users to group and query all 'sync' related counts
    > together.
    > 
    
    +1. A common prefix looks good and brings benefits such as what Amit mentioned.
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  7. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Dilip Kumar <dilipbalaut@gmail.com> — 2025-11-13T06:24:54Z

    On Thu, Nov 13, 2025 at 10:48 AM Chao Li <li.evan.chao@gmail.com> wrote:
    
    > >
    > > +1. Along with consistency with other column names, it will also make
    > > it easier for users to group and query all 'sync' related counts
    > > together.
    > >
    >
    > +1. A common prefix looks good and brings benefits such as what Amit mentioned.
    >
    +1 this makes sense.
    
    
    -- 
    Regards,
    Dilip Kumar
    Google
    
    
    
    
  8. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    vignesh C <vignesh21@gmail.com> — 2025-11-13T09:52:29Z

    On Thu, 13 Nov 2025 at 09:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
    >
    > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    > >
    > > CURRENT
    > > seq_sync_error_count
    > > sync_error_count
    > >
    > > MY SUGGESTION
    > > sync_seq_error_count
    > > sync_table_error_count
    > >
    >
    > +1. Along with consistency with other column names, it will also make
    > it easier for users to group and query all 'sync' related counts
    > together.
    
    This seems better, the attached v2 version patch has the changes for the same.
    
    Regards,
    Vignesh
    
  9. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Peter Smith <smithpb2250@gmail.com> — 2025-11-14T03:30:21Z

    On Thu, Nov 13, 2025 at 8:52 PM vignesh C <vignesh21@gmail.com> wrote:
    >
    > On Thu, 13 Nov 2025 at 09:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
    > >
    > > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    > > >
    > > > CURRENT
    > > > seq_sync_error_count
    > > > sync_error_count
    > > >
    > > > MY SUGGESTION
    > > > sync_seq_error_count
    > > > sync_table_error_count
    > > >
    > >
    > > +1. Along with consistency with other column names, it will also make
    > > it easier for users to group and query all 'sync' related counts
    > > together.
    >
    > This seems better, the attached v2 version patch has the changes for the same.
    >
    
    LGTM.
    
    ======
    Kind Regards,
    Peter Smith.
    Fujitsu Australia
    
    
    
    
  10. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Chao Li <li.evan.chao@gmail.com> — 2025-11-14T04:14:55Z

    
    > On Nov 13, 2025, at 17:52, vignesh C <vignesh21@gmail.com> wrote:
    > 
    > On Thu, 13 Nov 2025 at 09:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
    >> 
    >> On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    >>> 
    >>> CURRENT
    >>> seq_sync_error_count
    >>> sync_error_count
    >>> 
    >>> MY SUGGESTION
    >>> sync_seq_error_count
    >>> sync_table_error_count
    >>> 
    >> 
    >> +1. Along with consistency with other column names, it will also make
    >> it easier for users to group and query all 'sync' related counts
    >> together.
    > 
    > This seems better, the attached v2 version patch has the changes for the same.
    > 
    > Regards,
    > Vignesh
    > <v2-0001-Rename-sync_error_count-to-sync_table_error_count.patch>
    
    V2 overall looks good, a small comment is that the commit message need to be updated:
    
    ```
    Subject: [PATCH v2] Rename sync_error_count to sync_table_error_count in
     subscription statistics
    
    This patch renames the sync_error_count column to sync_table_error_count in
    the pg_stat_subscription_stats view. The new name makes the purpose explicit
    ```
    
    We now actually rename two fields.
    
    Best regards,
    --
    Chao Li (Evan)
    HighGo Software Co., Ltd.
    https://www.highgo.com/
    
    
    
    
    
    
    
    
  11. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Masahiko Sawada <sawada.mshk@gmail.com> — 2025-11-14T09:12:44Z

    On Wed, Nov 12, 2025 at 7:42 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
    >
    > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    > >
    > > CURRENT
    > > seq_sync_error_count
    > > sync_error_count
    > >
    > > MY SUGGESTION
    > > sync_seq_error_count
    > > sync_table_error_count
    > >
    >
    > +1. Along with consistency with other column names, it will also make
    > it easier for users to group and query all 'sync' related counts
    > together.
    
    +1
    
    -- 
    Masahiko Sawada
    Amazon Web Services: https://aws.amazon.com
    
    
    
    
  12. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Amit Kapila <amit.kapila16@gmail.com> — 2025-11-17T11:05:16Z

    On Thu, Nov 13, 2025 at 3:22 PM vignesh C <vignesh21@gmail.com> wrote:
    >
    > On Thu, 13 Nov 2025 at 09:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
    > >
    > > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    > > >
    > > > CURRENT
    > > > seq_sync_error_count
    > > > sync_error_count
    > > >
    > > > MY SUGGESTION
    > > > sync_seq_error_count
    > > > sync_table_error_count
    > > >
    > >
    > > +1. Along with consistency with other column names, it will also make
    > > it easier for users to group and query all 'sync' related counts
    > > together.
    >
    > This seems better, the attached v2 version patch has the changes for the same.
    >
    
    The patch looks good to me. I'll push this tomorrow unless there are
    any new reviews or suggestions.
    
    -- 
    With Regards,
    Amit Kapila.
    
    
    
    
  13. Re: Rename sync_error_count to tbl_sync_error_count in subscription statistics

    Amit Kapila <amit.kapila16@gmail.com> — 2025-11-18T06:01:46Z

    On Mon, Nov 17, 2025 at 4:35 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
    >
    > On Thu, Nov 13, 2025 at 3:22 PM vignesh C <vignesh21@gmail.com> wrote:
    > >
    > > On Thu, 13 Nov 2025 at 09:12, Amit Kapila <amit.kapila16@gmail.com> wrote:
    > > >
    > > > On Thu, Nov 13, 2025 at 4:31 AM Peter Smith <smithpb2250@gmail.com> wrote:
    > > > >
    > > > > CURRENT
    > > > > seq_sync_error_count
    > > > > sync_error_count
    > > > >
    > > > > MY SUGGESTION
    > > > > sync_seq_error_count
    > > > > sync_table_error_count
    > > > >
    > > >
    > > > +1. Along with consistency with other column names, it will also make
    > > > it easier for users to group and query all 'sync' related counts
    > > > together.
    > >
    > > This seems better, the attached v2 version patch has the changes for the same.
    > >
    >
    > The patch looks good to me. I'll push this tomorrow unless there are
    > any new reviews or suggestions.
    >
    
    Pushed.
    
    -- 
    With Regards,
    Amit Kapila.