Files
neon/docs/updating-postgres.md
Heikki Linnakangas dbdb8a1187 Document how to use "git merge" for PostgreSQL minor version upgrades. (#8692)
Our new policy is to use the "rebase" method and slice all the Neon
commits into a nice patch set when doing a new major version, and use
"merge" method on minor version upgrades on the release branches.

"git merge" preserves the git history of Neon commits on the Postgres
branches. While it's nice to rebase all the Neon changes to a logical
patch set against upstream, having to do it between every minor release
is a fair amount work, and it loses the history, and is more
error-prone.
2024-08-23 09:15:55 +03:00

2.3 KiB

Updating Postgres

Minor Versions

When upgrading to a new minor version of Postgres, please follow these steps:

Example: 15.4 is the new minor version to upgrade to from 15.3.

  1. Clone the Neon Postgres repository if you have not done so already.

    git clone git@github.com:neondatabase/postgres.git
    
  2. Add the Postgres upstream remote.

    git remote add upstream https://git.postgresql.org/git/postgresql.git
    
  3. Create a new branch based on the stable branch you are updating.

    git checkout -b my-branch-15 REL_15_STABLE_neon
    
  4. Find the upstream release tags you're looking for. They are of the form REL_X_Y.

  5. Merge the upstream tag into the branch you created on the tag and resolve any conflicts.

    git fetch upstream REL_15_4
    git merge REL_15_4
    

    In the commit message of the merge commit, mention if there were any non-trivial conflicts or other issues.

  6. Run the Postgres test suite to make sure our commits have not affected Postgres in a negative way.

    make check
    # OR
    meson test -C builddir
    
  7. Push your branch to the Neon Postgres repository.

    git push origin my-branch-15
    
  8. Clone the Neon repository if you have not done so already.

    git clone git@github.com:neondatabase/neon.git
    
  9. Create a new branch.

  10. Change the revisions.json file to point at the HEAD of your Postgres branch.

  11. Update the Git submodule.

    git submodule set-branch --branch my-branch-15 vendor/postgres-v15
    git submodule update --remote vendor/postgres-v15
    
  12. Run the Neon test suite to make sure that Neon is still good to go on this minor Postgres release.

    ./scripts/poetry -k pg15
    
  13. Commit your changes.

  14. Create a pull request, and wait for CI to go green.

  15. Push the Postgres branches with the merge commits into the Neon Postgres repository.

    git push origin my-branch-15:REL_15_STABLE_neon
    
  16. Update your Neon PR to point at the branches.

    git submodule set-branch --branch REL_15_STABLE_neon vendor/postgres-v15
    git commit --amend --no-edit
    git push --force origin
    
  17. Merge the pull request after getting approval(s) and CI completion.