PackageTrack

Go modules · #1957

github.com/stripe/pg-schema-diff

v1.0.9stripe/pg-schema-diff

Release timeline

57 releases since 2023
202420252026

Releases

  1. v1.0.96 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.828 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.73 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.63 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.57 Jan 2026
    Release notes

    What's Changed

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

    Open source →
  6. v1.0.47 Jan 2026
    Release notes

    What's Changed

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

    Open source →
  7. v1.0.331 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-996618536f902 Sept 2025pre-release

    Nothing published for this version

  9. v1.0.22 Sept 2025
    Release notes

    What's Changed

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

    Open source →
  10. v1.0.11 Sept 2025
    Release notes

    What's Changed

    New Contributors

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

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

    Nothing published for this version

  12. v1.0.1-0.20250826210422-f40bbbe945f826 Aug 2025pre-release

    Nothing published for this version

  13. v1.0.025 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.325 Aug 2025

    Nothing published for this version

  15. v0.9.3-0.20250825083957-bed0fd3a2d4625 Aug 2025pre-release

    Nothing published for this version

  16. v0.9.3-0.20250825080945-b34c69e5474325 Aug 2025pre-release

    Nothing published for this version

  17. v0.9.3-0.20250811161054-bd40c7b3a92511 Aug 2025pre-release

    Nothing published for this version

  18. v0.9.3-0.20250811045153-083748e7999e11 Aug 2025pre-release

    Nothing published for this version

  19. v0.9.211 Aug 2025

    Nothing published for this version

  20. v0.9.120 Jul 2025

    Nothing published for this version

  21. v0.9.1-0.20250331204010-2f423254bdb631 Mar 2025pre-release

    Nothing published for this version

  22. v0.9.011 Feb 2025

    Nothing published for this version

  23. v0.8.1-0.20241211224935-34273e554e3b11 Dec 2024pre-release

    Nothing published for this version

  24. v0.8.1-0.20241211011934-72e3df547e6711 Dec 2024pre-release

    Nothing published for this version

  25. v0.8.1-0.20241127202941-21fab6a86bb127 Nov 2024pre-release

    Nothing published for this version

  26. v0.8.02 Oct 2024

    Nothing published for this version

  27. v0.7.1-0.20241002190658-9216a8f3c2242 Oct 2024pre-release

    Nothing published for this version

  28. v0.7.1-0.20240921002210-f036cb2d903d21 Sept 2024pre-release

    Nothing published for this version

  29. v0.7.1-0.20240911170548-bc41f09a549511 Sept 2024pre-release

    Nothing published for this version

  30. v0.7.1-0.20240904160938-6937348e79824 Sept 2024pre-release

    Nothing published for this version

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

    Nothing published for this version

  32. v0.7.1-0.20240723161711-c63b0b73676723 Jul 2024pre-release

    Nothing published for this version

  33. v0.7.1-0.20240708203710-e5eafa80e4eb8 Jul 2024pre-release

    Nothing published for this version

  34. v0.7.1-0.20240705155903-8509c7f051da5 Jul 2024pre-release

    Nothing published for this version

  35. v0.7.1-0.20240610165506-9dd9ece7983b10 Jun 2024pre-release

    Nothing published for this version

  36. v0.7.1-0.20240530162545-41c8479d16b630 May 2024pre-release

    Nothing published for this version

  37. v0.7.029 May 2024

    Nothing published for this version

  38. v0.6.1-0.20240506155055-6319a93cc7776 May 2024pre-release

    Nothing published for this version

  39. v0.6.1-0.20240403180654-2a242c0dc03c3 Apr 2024pre-release

    Nothing published for this version

  40. v0.6.1-0.20240329234725-84422a16d2bd29 Mar 2024pre-release

    Nothing published for this version

  41. v0.6.1-0.20240321185415-20140e865dcc21 Mar 2024pre-release

    Nothing published for this version

  42. v0.6.1-0.20240313040624-0492c3e282e913 Mar 2024pre-release

    Nothing published for this version

  43. v0.6.1-0.20240219234134-b71f162b3cb919 Feb 2024pre-release

    Nothing published for this version

  44. v0.6.08 Feb 2024

    Nothing published for this version

  45. v0.5.1-0.20240208235840-7fc1d07ba7c38 Feb 2024pre-release

    Nothing published for this version

  46. v0.5.1-0.20240207201929-97fffc899c907 Feb 2024pre-release

    Nothing published for this version

  47. v0.5.1-0.20240205075200-43a6d6f69ebd5 Feb 2024pre-release

    Nothing published for this version

  48. v0.5.1-0.20240201190705-e10c39e527321 Feb 2024pre-release

    Nothing published for this version

  49. v0.5.011 Jan 2024

    Nothing published for this version

  50. v0.4.1-0.20240111164928-16eed43477cf11 Jan 2024pre-release

    Nothing published for this version

  51. v0.4.025 Oct 2023

    Nothing published for this version

  52. v0.3.1-0.20230824160948-8e25688f004824 Aug 2023pre-release

    Nothing published for this version

  53. v0.3.1-0.20230810222005-73d2361e627410 Aug 2023pre-release

    Nothing published for this version

  54. v0.3.010 Aug 2023

    Nothing published for this version

  55. v0.2.07 Jul 2023

    Nothing published for this version

  56. v0.1.1-0.20230707165844-a0d7b84811297 Jul 2023pre-release

    Nothing published for this version

  57. v0.1.02 Jun 2023

    Nothing published for this version