Thread

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pg_dump: Fix incorrect archive format shown in error message.

  1. use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Mahendra Singh Thalor <mahi6run@gmail.com> — 2025-04-14T22:21:12Z

    Hi hackers,
    
    In _allocAH function(pg_backup_archiver.c), we were using the *fmt*
    variable in switch case for *default case*, but correct variable is
    AH->format.
    
    Here, I am attaching a patch for the same.
    
    -- 
    Thanks and Regards
    Mahendra Singh Thalor
    EnterpriseDB: http://www.enterprisedb.com
    
  2. Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Fujii Masao <masao.fujii@oss.nttdata.com> — 2025-04-15T08:02:51Z

    
    On 2025/04/15 7:21, Mahendra Singh Thalor wrote:
    > Hi hackers,
    > 
    > In _allocAH function(pg_backup_archiver.c), we were using the *fmt* variable in switch case for *default case*, but correct variable is AH->format.
    > 
    > Here, I am attaching a patch for the same.
    
    Thanks for the report and patch! It looks good to me.
    Since this issue exists in the back branches,
    the patch needs be back-patched to all supported versions.
    
    Regards,
    
    -- 
    Fujii Masao
    Advanced Computing Technology Center
    Research and Development Headquarters
    NTT DATA CORPORATION
    
    
    
    
    
  3. Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Fujii Masao <masao.fujii@oss.nttdata.com> — 2025-04-15T08:47:23Z

    
    On 2025/04/15 17:02, Fujii Masao wrote:
    > 
    > 
    > On 2025/04/15 7:21, Mahendra Singh Thalor wrote:
    >> Hi hackers,
    >>
    >> In _allocAH function(pg_backup_archiver.c), we were using the *fmt* variable in switch case for *default case*, but correct variable is AH->format.
    >>
    >> Here, I am attaching a patch for the same.
    > 
    > Thanks for the report and patch! It looks good to me.
    > Since this issue exists in the back branches,
    > the patch needs be back-patched to all supported versions.
    
    Unless there are any objections, I'll commit the patch with
    the following commit message:
    
    ------------------
    pg_dump: Fix incorrect archive format shown in error message.
    
    In pg_dump and pg_restore, _allocAH() calls _discoverArchiveFormat() to
    determine the archive format when the input format is unknown one.
    If the input or discovered format is unrecognized, it reports an error
    including the archive format number.
    
    If discovered format is unrecognized, its number should be shown in
    the error message. But previously the error message mistakenly showed
    the originally requested format number (i.e., unknown one) instead of
    the discovered one, due to referencing the wrong variable in the error
    message.
    
    This commit corrects the issue by using the appropriate variable in
    the error message.
    
    In practice, this has no visible effect for users, since
    _discoverArchiveFormat() does not currently return unrecognized formats,
    so the error condition is never actually triggered.
    
    Back-patch to all supported versions.
    
    Author: Mahendra Singh Thalor <mahi6run@gmail.com>
    Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
    Discussion: https://postgr.es/m/CAKYtNAqu+N-Ab2Fq6wzNSOm_-0N-BMneanYNV1+6kFDXjva1Eg@mail.gmail.com
    Backpatch-through: 13
    ------------------
    
    Regards,
    
    -- 
    Fujii Masao
    Advanced Computing Technology Center
    Research and Development Headquarters
    NTT DATA CORPORATION
    
    
    
    
    
  4. Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Tom Lane <tgl@sss.pgh.pa.us> — 2025-04-15T14:37:36Z

    Fujii Masao <masao.fujii@oss.nttdata.com> writes:
    > Thanks for the report and patch! It looks good to me.
    
    Agreed.
    
    > Since this issue exists in the back branches,
    > the patch needs be back-patched to all supported versions.
    
    I doubt it's worth the trouble and buildfarm cycles to
    back-patch, since this should be a can't-happen code path.
    Worth fixing in HEAD, yes, but not convinced about doing
    more than that.
    
    			regards, tom lane
    
    
    
    
  5. Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Fujii Masao <masao.fujii@oss.nttdata.com> — 2025-04-16T04:30:24Z

    
    On 2025/04/15 23:37, Tom Lane wrote:
    > Fujii Masao <masao.fujii@oss.nttdata.com> writes:
    >> Thanks for the report and patch! It looks good to me.
    > 
    > Agreed.
    > 
    >> Since this issue exists in the back branches,
    >> the patch needs be back-patched to all supported versions.
    > 
    > I doubt it's worth the trouble and buildfarm cycles to
    > back-patch, since this should be a can't-happen code path.
    > Worth fixing in HEAD, yes, but not convinced about doing
    > more than that.
    
    Yes, that makes sense. I'll apply the fix to the master branch only.
    
    Regards,
    
    -- 
    Fujii Masao
    Advanced Computing Technology Center
    Research and Development Headquarters
    NTT DATA CORPORATION
    
    
    
    
    
  6. Re: use correct variable in error message in _allocAH function (pg_backup_archiver.c)

    Fujii Masao <masao.fujii@oss.nttdata.com> — 2025-04-17T01:01:08Z

    
    On 2025/04/16 13:30, Fujii Masao wrote:
    > 
    > 
    > On 2025/04/15 23:37, Tom Lane wrote:
    >> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
    >>> Thanks for the report and patch! It looks good to me.
    >>
    >> Agreed.
    >>
    >>> Since this issue exists in the back branches,
    >>> the patch needs be back-patched to all supported versions.
    >>
    >> I doubt it's worth the trouble and buildfarm cycles to
    >> back-patch, since this should be a can't-happen code path.
    >> Worth fixing in HEAD, yes, but not convinced about doing
    >> more than that.
    > 
    > Yes, that makes sense. I'll apply the fix to the master branch only.
    
    I've pushed the patch only to the master. Thanks!
    
    Regards,
    
    -- 
    Fujii Masao
    Advanced Computing Technology Center
    Research and Development Headquarters
    NTT DATA CORPORATION