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. Print new OldestXID value in pg_resetwal when it's being changed

  2. pg_resetxlog: add option to set oldest xid & use by pg_upgrade

  1. pg_resetwal prints new OldestXID in wrong circumstances

    Heikki Linnakangas <hlinnaka@iki.fi> — 2025-11-19T09:52:31Z

    When the --oldest-transaction-id option is used, pg_resetwal doesn't 
    print the new value like it does for other similar options. For example, 
    if you use --next-oid and --oldest-transaction-id, only the new NextOID 
    value is printed:
    
    > $ pg_resetwal --dry-run -D data --next-oid 10  --oldest-transaction-id 100
    > Current pg_control values:
    > 
    > ...
    > 
    > Values to be changed:
    > 
    > First log segment after reset:        000000010000000000000005
    > NextOID:                              10
    
    Printing the new OldestXID value is incorrectly tied to whether the 
    --next-transaction-id option is given, so this prints it, even though 
    OldestXID is not being modified:
    
    > $ pg_resetwal --dry-run -D data --next-oid 10  --next-transaction-id 100
    > Current pg_control values:
    > 
    > ...
    > 
    > 
    > Values to be changed:
    > 
    > First log segment after reset:        000000010000000000000005
    > NextOID:                              10
    > NextXID:                              100
    > OldestXID:                            744
    > OldestXID's DB:                       1
    
    This seems to have been an oversight when the --oldest-transaction-id 
    option was added (commit 74cf7d46a91d). Before that, OldestXID was reset 
    when the --next-transaction-id option was given.
    
    Fix attached. Barring objections, I will commit and backpatch this.
    
    - Heikki
    
  2. Re: pg_resetwal prints new OldestXID in wrong circumstances

    Bertrand Drouvot <bertranddrouvot.pg@gmail.com> — 2025-11-19T10:05:12Z

    Hi,
    
    On Wed, Nov 19, 2025 at 11:52:31AM +0200, Heikki Linnakangas wrote:
    > Printing the new OldestXID value is incorrectly tied to whether the
    > --next-transaction-id option is given, so this prints it, even though
    > OldestXID is not being modified:
    
    Nice catch!
    
    > This seems to have been an oversight when the --oldest-transaction-id option
    > was added (commit 74cf7d46a91d).
    
    yeah.
    
    > Before that, OldestXID was reset when the
    > --next-transaction-id option was given.
    > 
    > Fix attached. Barring objections, I will commit and backpatch this.
    
    LGTM, thanks!
    
    Regards,
    
    -- 
    Bertrand Drouvot
    PostgreSQL Contributors Team
    RDS Open Source Databases
    Amazon Web Services: https://aws.amazon.com
    
    
    
    
  3. Re: pg_resetwal prints new OldestXID in wrong circumstances

    Heikki Linnakangas <hlinnaka@iki.fi> — 2025-11-19T16:08:22Z

    On 19/11/2025 12:05, Bertrand Drouvot wrote:
    > On Wed, Nov 19, 2025 at 11:52:31AM +0200, Heikki Linnakangas wrote:
    >> Printing the new OldestXID value is incorrectly tied to whether the
    >> --next-transaction-id option is given, so this prints it, even though
    >> OldestXID is not being modified:
    > 
    > Nice catch!
    > 
    >> This seems to have been an oversight when the --oldest-transaction-id option
    >> was added (commit 74cf7d46a91d).
    > 
    > yeah.
    > 
    >> Before that, OldestXID was reset when the
    >> --next-transaction-id option was given.
    >>
    >> Fix attached. Barring objections, I will commit and backpatch this.
    > 
    > LGTM, thanks!
    
    Committed, thanks!
    
    - Heikki