From 40f04e0dcd387a8741934936f7687f83ed6fce43 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Fri, 30 Oct 2026 15:49:25 -0500 Subject: [PATCH 1/3] Release 1.1.0 (distribution-only; extension stays at 1.0.0) The only change since 1.0.0 that reaches users is that the extension no longer requires superuser to install. That lives in the control file, not in any SQL, so the extension version stays at 1.0.0 and only the distribution version moves. default_version is pinned to 1.0.0 for the tag; it returns to `stable` right after. A root .gitattributes keeps the `--stable` scripts out of the release archive. --- .gitattributes | 1 + HISTORY.md | 6 ++++-- META.in.json | 2 +- META.json | 2 +- count_nulls.control | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c1fec59 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +sql/*--stable.sql export-ignore diff --git a/HISTORY.md b/HISTORY.md index d811ed6..1177447 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,7 +1,9 @@ # count_nulls history -stable ------- +1.1.0 +----- + +Distribution-only release - the extension version itself stays at `1.0.0`. - Extension no longer requires superuser to install diff --git a/META.in.json b/META.in.json index c730255..82cfaca 100644 --- a/META.in.json +++ b/META.in.json @@ -16,7 +16,7 @@ "name": "count_nulls", "X_comment": "REQUIRED. Version of the distribution. http://pgxn.org/spec/#version", - "version": "1.0.0", + "version": "1.1.0", "X_comment": "REQUIRED. Short description of distribution.", "abstract": "Count the number of null arguments", diff --git a/META.json b/META.json index 19c84e1..9134d2b 100644 --- a/META.json +++ b/META.json @@ -16,7 +16,7 @@ "name": "count_nulls", "X_comment": "REQUIRED. Version of the distribution. http://pgxn.org/spec/#version", - "version": "1.0.0", + "version": "1.1.0", "X_comment": "REQUIRED. Short description of distribution.", "abstract": "Count the number of null arguments", diff --git a/count_nulls.control b/count_nulls.control index 19fcff1..41aa063 100644 --- a/count_nulls.control +++ b/count_nulls.control @@ -1,6 +1,6 @@ # count_nulls extension comment = 'Count the number of null arguments' -default_version = 'stable' +default_version = '1.0.0' relocatable = false # Pure SQL functions, nothing privileged - anyone with USAGE and CREATE on the # target schema can install it, holding nothing on the database itself. From dd5d9b60f27269101392f6857b00c1f903cf443e Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Fri, 30 Oct 2026 16:03:38 -0500 Subject: [PATCH 2/3] Remove --stable scripts and .gitattributes from the release The release commit carries no *--stable* files; the return-to-stable PR after the tag re-seeds them. export-ignore is no longer needed. --- .gitattributes | 1 - sql/count_nulls--1.0.0--stable.sql | 1 - sql/count_nulls--stable.sql | 87 ------------------------------ 3 files changed, 89 deletions(-) delete mode 100644 .gitattributes delete mode 100644 sql/count_nulls--1.0.0--stable.sql delete mode 100644 sql/count_nulls--stable.sql diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index c1fec59..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -sql/*--stable.sql export-ignore diff --git a/sql/count_nulls--1.0.0--stable.sql b/sql/count_nulls--1.0.0--stable.sql deleted file mode 100644 index dc73d7b..0000000 --- a/sql/count_nulls--1.0.0--stable.sql +++ /dev/null @@ -1 +0,0 @@ --- No actual SQL changes to this version bump diff --git a/sql/count_nulls--stable.sql b/sql/count_nulls--stable.sql deleted file mode 100644 index ef7c3b5..0000000 --- a/sql/count_nulls--stable.sql +++ /dev/null @@ -1,87 +0,0 @@ -/* DO NOT EDIT - AUTO-GENERATED FILE */ -CREATE OR REPLACE FUNCTION null_count( - VARIADIC argument anyarray -) RETURNS int LANGUAGE sql IMMUTABLE AS $body$ - SELECT sum( CASE WHEN a IS NULL THEN 1 ELSE 0 END )::int - FROM unnest( $1 ) a -$body$; - -CREATE OR REPLACE FUNCTION null_count( - argument jsonb -) RETURNS int LANGUAGE sql IMMUTABLE AS $body$ -SELECT count(*)::int - FROM jsonb_each_text( $1 ) a - WHERE value IS NULL -$body$; -CREATE OR REPLACE FUNCTION null_count( - argument json -) RETURNS int LANGUAGE sql IMMUTABLE AS 'SELECT @extschema@.null_count($1::jsonb)'; - -CREATE OR REPLACE FUNCTION null_count_trigger( -) RETURNS trigger LANGUAGE plpgsql IMMUTABLE AS $body$ -DECLARE - c_msg CONSTANT text := coalesce( - nullif( TG_ARGV[1], 'null' ) - , format( '%s must contain %s NULL fields', TG_RELID::regclass, TG_ARGV[0] ) - ); -BEGIN - IF TG_NARGS NOT BETWEEN 1 AND 2 THEN - RAISE '% usage: number of NULL columns[, error message]', TG_NAME; - END IF; - -- Casing intentional for cut/paste/replace/ - IF nullif(TG_ARGV[0], 'null') IS null THEN - RAISE '%: first argument must not be null', TG_NAME; - END IF; - - IF @extschema@.null_count( row_to_json(NEW) ) <> TG_ARGV[0]::int THEN - RAISE '%', c_msg; - END IF; - - RETURN NEW; -END -$body$; - - -CREATE OR REPLACE FUNCTION not_null_count( - VARIADIC argument anyarray -) RETURNS int LANGUAGE sql IMMUTABLE AS $body$ - SELECT sum( CASE WHEN a IS NOT NULL THEN 1 ELSE 0 END )::int - FROM unnest( $1 ) a -$body$; - -CREATE OR REPLACE FUNCTION not_null_count( - argument jsonb -) RETURNS int LANGUAGE sql IMMUTABLE AS $body$ -SELECT count(*)::int - FROM jsonb_each_text( $1 ) a - WHERE value IS NOT NULL -$body$; -CREATE OR REPLACE FUNCTION not_null_count( - argument json -) RETURNS int LANGUAGE sql IMMUTABLE AS 'SELECT @extschema@.not_null_count($1::jsonb)'; - -CREATE OR REPLACE FUNCTION not_null_count_trigger( -) RETURNS trigger LANGUAGE plpgsql IMMUTABLE AS $body$ -DECLARE - c_msg CONSTANT text := coalesce( - nullif( TG_ARGV[1], 'null' ) - , format( '%s must contain %s NOT NULL fields', TG_RELID::regclass, TG_ARGV[0] ) - ); -BEGIN - IF TG_NARGS NOT BETWEEN 1 AND 2 THEN - RAISE '% usage: number of NOT NULL columns[, error message]', TG_NAME; - END IF; - -- Casing intentional for cut/paste/replace/ - IF nullif(TG_ARGV[0], 'null') IS null THEN - RAISE '%: first argument must not be null', TG_NAME; - END IF; - - IF @extschema@.not_null_count( row_to_json(NEW) ) <> TG_ARGV[0]::int THEN - RAISE '%', c_msg; - END IF; - - RETURN NEW; -END -$body$; - --- vi: expandtab sw=2 ts=2 From e6836b9902b7aedf225dc00073f8f451afd8b297 Mon Sep 17 00:00:00 2001 From: jnasbyupgrade Date: Fri, 30 Oct 2026 17:06:03 -0500 Subject: [PATCH 3/3] Re-trigger CI