Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DATA = snowflake--1.0.sql \
snowflake--2.2--2.3.sql \
snowflake--2.3.sql \
snowflake--2.3--2.4.sql \
snowflake--2.4--2.5.sql
snowflake--2.4--2.5.0.sql
Comment thread
mason-sharp marked this conversation as resolved.
PGFILEDESC = "snowflake - snowflake style IDs for PostgreSQL"

REGRESS = conversion maxvalue repair
Expand Down
39 changes: 39 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

All notable changes to the Snowflake extension are documented here.

## 2.5.0 (unreleased)

### Added

- PG18 support: added a PG18 test configuration and adjusted the Docker
build to skip LLVM bitcode compilation on PG18.

### Changed

- Adopted three-digit (`MAJOR.MINOR.PATCH`) versioning. The extension
version is now `2.5.0`.

### Fixed

- Fixed dump/restore of snowflake-converted sequences.
`convert_sequence_to_snowflake()` previously left `MAXVALUE` at
`(old last_value + 1)`, but `snowflake.nextval()` bypasses `MAXVALUE`
and writes snowflake-sized values, so `pg_dump` could emit a `setval()`
that failed to restore. Sequences are now converted with
`AS bigint MAXVALUE 9223372036854775807`, and sequences converted by
earlier versions are auto-repaired on upgrade. (SUP-140)
- Fixed the SQL command used to convert sequences to Snowflake.
Comment thread
mason-sharp marked this conversation as resolved.

### Security / CI

- Pinned GitHub Actions to full commit SHAs to harden against supply
chain attacks.
- Removed `shell=True` and shell-injection risks from test runner and
helper subprocess calls; use `shlex.split()` for correct argument
tokenization.
- Fixed a SQL injection warning and a missing parameter in
`execute_sqlite_query`, and suppressed Bandit B603 warnings on internal
test helper subprocess calls.
- Fixed the Dockerfile `ARG` handling for newer BuildKit versions.
- Updated the copyright year to 2026.
4 changes: 2 additions & 2 deletions expected/repair.out
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ FROM pg_sequences WHERE sequencename = 'standalone_seq';
(1 row)

-- ----------------------------------------------------------------------
-- Upgrade to 2.5: the repair block runs automatically. Suppress its
-- Upgrade to 2.5.0: the repair block runs automatically. Suppress its
-- NOTICEs so the test output does not depend on repair ordering.
-- ----------------------------------------------------------------------
SET client_min_messages = warning;
ALTER EXTENSION snowflake UPDATE TO '2.5';
ALTER EXTENSION snowflake UPDATE TO '2.5.0';
RESET client_min_messages;
-- Both sequences must now carry the full bigint ceiling.
SELECT sequencename, max_value = 9223372036854775807 AS repaired
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ nav:
- Converting an Existing Postgres Sequence: converting.md
- Using Snowflake Functions: snowflake_functions.md
- Reviewing Snowflake Meta-Data: review_seq.md
- Changelog: changelog.md
4 changes: 2 additions & 2 deletions snowflake--2.4--2.5.sql → snowflake--2.4--2.5.0.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* snowflake--2.4--2.5.sql */
/* snowflake--2.4--2.5.0.sql */

-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION snowflake UPDATE TO '2.5'" to load this file. \quit
\echo Use "ALTER EXTENSION snowflake UPDATE TO '2.5.0'" to load this file. \quit

-- ----------------------------------------------------------------------
-- 2.4 -> 2.5 - fix MAXVALUE on snowflake-converted sequences.
Expand Down
2 changes: 1 addition & 1 deletion snowflake.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# snowflake extension
comment = 'Snowflake style IDs for PostgreSQL'
default_version = '2.5'
default_version = '2.5.0'
module_pathname = '$libdir/snowflake'
relocatable = false
schema = snowflake
4 changes: 2 additions & 2 deletions sql/repair.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ SELECT max_value < 9223372036854775807 AS max_is_low,
FROM pg_sequences WHERE sequencename = 'standalone_seq';

-- ----------------------------------------------------------------------
-- Upgrade to 2.5: the repair block runs automatically. Suppress its
-- Upgrade to 2.5.0: the repair block runs automatically. Suppress its
-- NOTICEs so the test output does not depend on repair ordering.
-- ----------------------------------------------------------------------
SET client_min_messages = warning;
ALTER EXTENSION snowflake UPDATE TO '2.5';
ALTER EXTENSION snowflake UPDATE TO '2.5.0';
RESET client_min_messages;

-- Both sequences must now carry the full bigint ceiling.
Expand Down
Loading