Skip to content

feat: pgclone.diff() — schema DDL drift detection (v4.1.0) - #4

Merged
valehdba merged 4 commits into
mainfrom
feature/v4.1.0-schema-diff
May 4, 2026
Merged

feat: pgclone.diff() — schema DDL drift detection (v4.1.0)#4
valehdba merged 4 commits into
mainfrom
feature/v4.1.0-schema-diff

Conversation

@valehdba

@valehdba valehdba commented May 4, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 🏗️ Refactor / internal cleanup (no functional change)
  • ⚡ Performance improvement
  • 📖 Documentation only
  • 🔧 Build / CI / tooling
  • 🧪 Test-only change

Description of changes

Database / SQL changes

  • New or modified SQL functions are declared in sql/pgclone--<version>.sql
  • PG_FUNCTION_INFO_V1 names in C match the AS '<lib>', '<sym>' clauses in SQL
  • Return types in .sql match the C PG_RETURN_* paths
  • COMMENT ON FUNCTION ... added for new public functions
  • Function volatility (VOLATILE / STABLE / IMMUTABLE) and PARALLEL safety set correctly

Testing

PostgreSQL versions tested locally:

  • pgTAP tests added or updated in test/pgclone_test.sql
  • plan() count exactly matches the actual number of assertions
  • Shell tests added/updated in test/test_async.sh or test/test_database_create.sh (if applicable)
  • test/fixtures/seed.sql updated if new test objects are needed
  • CI is green on all of PG 14, 15, 16, 17, 18
# Output of pre_deploy_checks.sh (paste the summary line)
# e.g. "22 passed, 0 failed"

C code safety checklist

  • palloc / palloc0 / pfree only — no malloc/free
  • Every PQconnectdb has a matching PQfinish in all paths (success and error)
  • Every PQexec result is PQclear-ed in all paths
  • Dynamic SQL uses quote_literal_cstr() and quote_identifier()
  • StringInfo used for dynamic strings; no fixed stack buffers for SQL
  • strlcpy instead of strcpy / strncpy
  • ereport / elog with appropriate level — connection strings never logged at LOG level or above
  • PG-version-specific APIs are guarded with #if PG_VERSION_NUM >= XXXXXX
  • No new uses of removed APIs (d.adsrc, pre-PG15 shmem-request pattern, etc.)
  • Shared-memory state protected by LWLock where needed

Documentation

  • CHANGELOG.md updated under the appropriate version heading
  • Relevant doc updated: docs/USAGE.md / docs/ASYNC.md / docs/ARCHITECTURE.md / docs/TESTING.md
  • README.md updated if the change affects the user-facing feature list or quick-start

Version bump

  • pgclone.control (default_version)
  • META.json (version and provides.pgclone.version + file)
  • README.md version badge
  • New sql/pgclone--<old>--<new>.sql migration script (if applicable)
  • CHANGELOG.md has a heading for the new version

Backward compatibility

Screenshots / sample output

Additional notes

@valehdba
valehdba merged commit e29019b into main May 4, 2026
5 checks passed
@valehdba
valehdba deleted the feature/v4.1.0-schema-diff branch May 5, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant