PackageTrack
Sign in Get early access

github.com/stripe/pg-schema-diff

v1.0.9 #1957 most downloaded on Go modules stripe/pg-schema-diff

What this package is like to depend on

Last release 18 days ago

06 Aug 2026

Release timing varies

gaps range from 8 days to 6 months

Some releases are documented

notes for 10 of 22 stable releases

Nothing withdrawn

no release was ever pulled

3 years old

57 releases · first in 2023

10 releases in the last 12 months

see the full history below

Release timeline

57 releases · Jun 2023 to Aug 2026
2024 2025 2026
Release Pre-release

Releases

latest 57
  1. v1.0.9 06 Aug 2026
    Release notes

    Fix: Materialized view reconstruction uses WITH NO DATA

    During plan validation, setSchemaForEmptyDatabase reconstructs the source schema in a temporary database. For materialized views, the Add() method previously emitted CREATE MATERIALIZED VIEW ... AS <query> without WITH NO DATA, causing Postgres to execute the view's stored query. This is unnecessary (the temp DB is discarded immediately) and potentially unsafe.

    Changes

    • Append WITH NO DATA to all CREATE MATERIALIZED VIEW DDL generated during schema reconstruction
    • Strip trailing semicolons from pg_get_viewdef() output to prevent syntax errors when appending WITH NO DATA

    Files changed

    • pkg/diff/materialized_view_sql_generator.go
    • pkg/diff/schema_migration_plan_test.go (3 new unit tests)

    Full PR: #305

    Open source →
  2. v1.0.8 28 Jul 2026
    Release notes

    Security fix

    Fixes search_path shadowing in bigint-to-timestamp column migrations (CVE-2018-1058, #298).

    Bigint → timestamp USING clause (sql_generator.go)

    When migrating a bigint column to timestamp without time zone, pg-schema-diff emits a to_timestamp() call in the ALTER COLUMN ... USING clause. An unqualified call resolves via search_path, so a user with CREATE on a schema can plant shadow functions that run during apply instead of the built-ins.

    Fix: emit a fully qualified expression:

    pg_catalog.to_timestamp(
      col::pg_catalog.float8 OPERATOR(pg_catalog./) 1000.0::pg_catalog.float8
    )

    What's Changed

    • fix: qualify pg_catalog.to_timestamp in bigint-to-timestamp migrations (#298)

    Full Changelog: v1.0.7...v1.0.8

    Open source →
  3. v1.0.7 03 Jul 2026
    Release notes

    Security fixes

    Fixes two additional SQL injection sinks identified via the same root cause as v1.0.6 (enum labels, #295). Schema-derived values were re-emitted into generated DDL without proper escaping.

    Policy role names (policy_sql_generator.go)

    AppliesTo role names (sourced from pg_roles.rolname) were interpolated raw into CREATE POLICY ... TO and ALTER POLICY ... TO statements. A user with CREATEROLE privilege could plant a role whose name contains an embedded double-quote to inject arbitrary SQL during plan execution.

    Fix: Added escapeRoleNames() helper that applies EscapeIdentifier to each role name, preserving PUBLIC as an unquoted SQL keyword.

    Function/procedure names (schema.go buildProcName)

    The function used hand-rolled quoting (fmt.Sprintf("\"%s\"(%s)", name, ...)) that did not double embedded double-quotes. A user with CREATE FUNCTION privilege could create a function with " in its name to inject SQL when DROP FUNCTION/DROP PROCEDURE statements are generated.

    Fix: Replaced the hand-rolled quoting with EscapeIdentifier(name).

    What's Changed

    • fix: escape policy role names and function/procedure names in generated SQL (#296)

    Full Changelog: v1.0.6...v1.0.7

    Open source →
  4. v1.0.6 03 Jul 2026
    Release notes

    Security fix

    Escapes enum labels in generated SQL to prevent a second-order SQL injection.

    Enum labels were interpolated into generated DDL using raw fmt.Sprintf("'%s'", val). A label containing a single quote could break out of the string literal and inject arbitrary SQL, which then executes with the plan runner's (often superuser) privileges when pg-schema-diff generates migration SQL — enabling RCE via COPY ... TO PROGRAM.

    All three enum sinks (CREATE TYPE ... AS ENUM, ALTER TYPE ... ADD VALUE, and the BEFORE ordering clause) now route through a new EscapeLiteral helper that doubles single quotes and strips null bytes.

    See #295 for details and test evidence.

    Recommendation: upgrade to v1.0.6, especially if you run pg-schema-diff against databases where lower-privileged users can create enum types.

    Open source →
  5. v1.0.5 07 Jan 2026
    Release notes

    What's Changed

    Full Changelog: v1.0.4...v1.0.5

    Open source →
  6. v1.0.4 07 Jan 2026
    Release notes

    What's Changed

    Full Changelog: v1.0.3...v1.0.4

    Open source →
  7. v1.0.3 31 Dec 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.0.2...v1.0.3

    Open source →
  8. v1.0.3-0.20250902170109-996618536f90 02 Sep 2025 pre-release

    Nothing published for this version

  9. v1.0.2 02 Sep 2025
    Release notes

    What's Changed

    Full Changelog: v1.0.1...v1.0.2

    Open source →
  10. v1.0.1 01 Sep 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v1.0.0...v1.0.1

    Open source →
  11. v1.0.1-0.20250827201201-3efa9b9908f9 27 Aug 2025 pre-release

    Nothing published for this version

  12. v1.0.1-0.20250826210422-f40bbbe945f8 26 Aug 2025 pre-release

    Nothing published for this version

  13. v1.0.0 25 Aug 2025
    Release notes

    Releasing first major version, since the API has stabilized.

    What's Changed

    Full Changelog: v0.9.3...v1.0.0

    Open source →
  14. v0.9.3 25 Aug 2025

    Nothing published for this version

  15. v0.9.3-0.20250825083957-bed0fd3a2d46 25 Aug 2025 pre-release

    Nothing published for this version

  16. v0.9.3-0.20250825080945-b34c69e54743 25 Aug 2025 pre-release

    Nothing published for this version

  17. v0.9.3-0.20250811161054-bd40c7b3a925 11 Aug 2025 pre-release

    Nothing published for this version

  18. v0.9.3-0.20250811045153-083748e7999e 11 Aug 2025 pre-release

    Nothing published for this version

  19. v0.9.2 11 Aug 2025

    Nothing published for this version

  20. v0.9.1 20 Jul 2025

    Nothing published for this version

  21. v0.9.1-0.20250331204010-2f423254bdb6 31 Mar 2025 pre-release

    Nothing published for this version

  22. v0.9.0 11 Feb 2025

    Nothing published for this version

  23. v0.8.1-0.20241211224935-34273e554e3b 11 Dec 2024 pre-release

    Nothing published for this version

  24. v0.8.1-0.20241211011934-72e3df547e67 11 Dec 2024 pre-release

    Nothing published for this version

  25. v0.8.1-0.20241127202941-21fab6a86bb1 27 Nov 2024 pre-release

    Nothing published for this version

  26. v0.8.0 02 Oct 2024

    Nothing published for this version

  27. v0.7.1-0.20241002190658-9216a8f3c224 02 Oct 2024 pre-release

    Nothing published for this version

  28. v0.7.1-0.20240921002210-f036cb2d903d 21 Sep 2024 pre-release

    Nothing published for this version

  29. v0.7.1-0.20240911170548-bc41f09a5495 11 Sep 2024 pre-release

    Nothing published for this version

  30. v0.7.1-0.20240904160938-6937348e7982 04 Sep 2024 pre-release

    Nothing published for this version

  31. v0.7.1-0.20240831073412-6ca546f053a2 31 Aug 2024 pre-release

    Nothing published for this version

  32. v0.7.1-0.20240723161711-c63b0b736767 23 Jul 2024 pre-release

    Nothing published for this version

  33. v0.7.1-0.20240708203710-e5eafa80e4eb 08 Jul 2024 pre-release

    Nothing published for this version

  34. v0.7.1-0.20240705155903-8509c7f051da 05 Jul 2024 pre-release

    Nothing published for this version

  35. v0.7.1-0.20240610165506-9dd9ece7983b 10 Jun 2024 pre-release

    Nothing published for this version

  36. v0.7.1-0.20240530162545-41c8479d16b6 30 May 2024 pre-release

    Nothing published for this version

  37. v0.7.0 29 May 2024

    Nothing published for this version

  38. v0.6.1-0.20240506155055-6319a93cc777 06 May 2024 pre-release

    Nothing published for this version

  39. v0.6.1-0.20240403180654-2a242c0dc03c 03 Apr 2024 pre-release

    Nothing published for this version

  40. v0.6.1-0.20240329234725-84422a16d2bd 29 Mar 2024 pre-release

    Nothing published for this version

  41. v0.6.1-0.20240321185415-20140e865dcc 21 Mar 2024 pre-release

    Nothing published for this version

  42. v0.6.1-0.20240313040624-0492c3e282e9 13 Mar 2024 pre-release

    Nothing published for this version

  43. v0.6.1-0.20240219234134-b71f162b3cb9 19 Feb 2024 pre-release

    Nothing published for this version

  44. v0.6.0 08 Feb 2024

    Nothing published for this version

  45. v0.5.1-0.20240208235840-7fc1d07ba7c3 08 Feb 2024 pre-release

    Nothing published for this version

  46. v0.5.1-0.20240207201929-97fffc899c90 07 Feb 2024 pre-release

    Nothing published for this version

  47. v0.5.1-0.20240205075200-43a6d6f69ebd 05 Feb 2024 pre-release

    Nothing published for this version

  48. v0.5.1-0.20240201190705-e10c39e52732 01 Feb 2024 pre-release

    Nothing published for this version

  49. v0.5.0 11 Jan 2024

    Nothing published for this version

  50. v0.4.1-0.20240111164928-16eed43477cf 11 Jan 2024 pre-release

    Nothing published for this version

  51. v0.4.0 25 Oct 2023

    Nothing published for this version

  52. v0.3.1-0.20230824160948-8e25688f0048 24 Aug 2023 pre-release

    Nothing published for this version

  53. v0.3.1-0.20230810222005-73d2361e6274 10 Aug 2023 pre-release

    Nothing published for this version

  54. v0.3.0 10 Aug 2023

    Nothing published for this version

  55. v0.2.0 07 Jul 2023

    Nothing published for this version

  56. v0.1.1-0.20230707165844-a0d7b8481129 07 Jul 2023 pre-release

    Nothing published for this version

  57. v0.1.0 02 Jun 2023

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive