Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dimitri/pgcopydb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: academia-edu/pgcopydb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Sep 25, 2025

  1. Fix database source is already in use

    when using clone with --follow and --filter
    ahmad-sanad committed Sep 25, 2025
    Configuration menu
    Copy the full SHA
    142700d View commit details
    Browse the repository at this point in the history
  2. Fix Syntax error at or near "\"

    Postgres 17.6 added \restrict and \unrestrict metacommands to pg_dump to
    mitigate a security issue. This code skips these lines when restoring
    roles.
    
    17.6 release: https://www.postgresql.org/docs/17/release-17-6.html#RELEASE-17-6-CHANGES
    CVE: https://www.postgresql.org/support/security/CVE-2025-8714/
    ahmad-sanad committed Sep 25, 2025
    Configuration menu
    Copy the full SHA
    c5a7be9 View commit details
    Browse the repository at this point in the history
  3. Fix catalog mismatch issue

    Caused by using commands that support filter after ones that don't, or vice versa. For example, snapshot then clone --filter or clone --filter then stream sentinel. Try to deduce which filters should be used or give an error when that isn't straightforward.
    ahmad-sanad committed Sep 25, 2025
    Configuration menu
    Copy the full SHA
    dc66c92 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2025

  1. Fix no open transaction in clone --follow --snapshot

    When calling snapshot then using the snapshot id with `clone --follow
    --snapshot` the code fails with "BUG: call to pgsql_commit() without holding an open multi statement connection"
    
    `clone_and_follow` calls `copydb_fetch_schema_and_prepare_specs` which calls
    `copydb_prepare_snapshot` since `specs->sourceSnapshot.state` is initially `SNAPSHOT_STATE_UNKNOWN`. `copydb_fetch_schema_and_prepare_specs` later calls `copydb_close_snapshot` which commits the transaction and sets the snapshot state to `SNAPSHOT_STATE_CLOSED`
    
    `clone_and_follow` later calls `start_clone_process` which calls `cloneDB` which calls `copydb_fetch_schema_and_prepare_specs` again. This time `specs->sourceSnapshot.state` is `SNAPSHOT_STATE_CLOSED` so `copydb_prepare_snapshot` is not called. The code later tries to set the search path, which fails with a warning, then tries to commit the transaction, which fails with this error since no transaction was opened.
    
    `copydb_prepare_snapshot` checks if the source snapshot state is `SNAPSHOT_STATE_UNKNOWN` or `SNAPSHOT_STATE_CLOSED` in order to prepare the snapshshot and open a transaction.
    `copydb_fetch_schema_and_prepare_specs` on the other hand, only calls `copydb_prepare_snapshot` if the snapshot state is `SNAPSHOT_STATE_UNKNOWN`.
    This code changes `copydb_fetch_schema_and_prepare_specs` to match `copydb_prepare_snapshot` and call it in either state.
    ahmad-sanad committed Sep 26, 2025
    Configuration menu
    Copy the full SHA
    1a3c113 View commit details
    Browse the repository at this point in the history
Loading