make pgtle’s version-limiting variable was named `PGTLE_VERSION, which
make auto-imports from an identically-named environment variable. That name
is also a natural choice for a CI job’s "which pg_tle to test against" env
var — when one was set, make pgtle/make run-pgtle silently misbehaved
instead of erroring. Renamed to PGXNTOOL_PGTLE_VERSION to avoid the
collision. If you invoke make pgtle PGTLE_VERSION=… directly, update it
to PGXNTOOL_PGTLE_VERSION.
base.mk’s `DATA wildcard (sql/----.sql) only matched upgrade scripts
(two -- separators), silently skipping historical full-install scripts
like sql/ext—0.9.6.sql (one --) even though these are meant to be
committed to git. make install never placed them in the extension
directory, so CREATE EXTENSION ext VERSION 'x.y.z' failed for any version
older than current. Widened to sql/--*.sql, which matches both.
.IGNORE: installcheck made make treat installcheck as always successful
regardless of pg_regress’s exit status, and `test’s recipe only `cat`ed
`regression.diffs for visibility without checking it. make test now exits
non-zero when regression.diffs is non-empty, after printing it.
Issues fixed in this release: #35, #49, #78, #79, #48
make test now fails if test/expected/.out (or test/build/expected/.out)
has no corresponding test/sql/.sql (or test/build/.sql). If your project
has genuinely stale expected-output files sitting around, make test will
newly fail until they’re removed. pg_regress’s alternate expected-output
files (test_0.out .. test_9.out) are recognized and not flagged as stale.
The old name implied it listed every version file for an extension; it
actually only ever holds the current/most-recent one per extension. If your
Makefile references EXTENSION_VERSION_FILES directly (e.g. to add extra
dependencies to DATA), update it to EXTENSIONCURRENT_VERSIONFILES.
There was no way to tell which pgxntool version a project had embedded via
git subtree short of digging through git history. make pgxntool-version
(and pgxntool/bin/version directly) now prints it, read from the
first line of pgxntool/HISTORY.asc — the same line the release process
stamps with the version number. The line is rejected unless it’s STABLE
or a plain X.Y.Z version (digits only, no pre-release suffixes).
These targets hardcoded the origin remote, silently re-tagging the wrong
repository for maintainers whose origin is a personal fork. Defaults to
origin, so existing behavior is unchanged unless you set it.
base.mk’s `pgtle target never passed the PGTLE_VERSION make variable
through to pgtle.sh --pgtle-version, so it silently generated all pg_tle
version ranges regardless of the value given on the command line.
extract_version_from_filename() required every version segment to start
with a digit, so extensions using a persistent stable pseudo-version
(default_version = 'stable') failed with "Cannot parse version from
filename". Widened to accept any non-empty, ---free version string,
matching how pg_tle itself treats extension versions.
The rule generating sql/<ext>--<version>.sql used a > truncate followed
by a separate >> append, so a rule that fired more than once (e.g.
overlapping make processes) doubled the file’s content. Now uses a single
atomic redirect.
base.mk could end up included twice in one make run (for example, an
extension’s own .mk module includes it in addition to the Makefile’s own
include), which redefined every target and printed overriding-recipe
warnings. A second inclusion is now a harmless no-op.
These scripts guarded the project root with [ -d .git ]. In a linked worktree
.git is a file, not a directory, so the check failed: setup.sh would wrongly
re-run git init, and the sync scripts aborted with "Not in a git repository."
They now detect the repo with git rev-parse --git-dir, which works in both a
normal clone and a worktree.
make results ran verify-results before make test, so it checked stale
regression.diffs from a prior run. Reordered so verify-results always
checks the fresh results.
Without override, the pgxntool_validate_yesno normalization was silently
skipped when these variables were set on the command line.
make pgxntool-sync pointed at the old SSH URL, which fails without
GitHub SSH keys; it now uses https://github.com/Postgres-Extensions/pgxntool.git
over HTTPS (still the release tag). The subtree pull + update-setup-files.sh
logic moved into pgxntool/pgxntool-sync.sh, which the make targets now wrap, so
you can also sync without make by running it directly.
Control file values like default_version = '1.0.0' # comment were parsed
incorrectly — the trailing quote was left in the value due to comment removal
happening after quote stripping. Fixed by removing comments first.
Mac OS uses the (very old) bash 3.2 as the default shell; fix a few compatibility bugs.
PostgreSQL removed .source file processing from pg_regress in PG15.
The input/.source → sql/.sql and output/.source →
expected/.out conversion mechanism no longer functions. All related
variables (TESTSOURCE*), the make_results.sh helper script, and
the special-case logic in make results have been removed. Extensions
that used .source files should convert them to regular test/sql/.sql
and test/expected/.out files using relative paths.
When CREATE EXTENSION fails due to a SQL syntax error, PostgreSQL reports only a cryptic error with limited context. test-build runs your extension SQL directly through pg_regress first, so syntax errors show the exact file, line, and position — cutting debugging time significantly. Place SQL files in test/build/ to enable; auto-detects based on file presence.
Extensions that install dependencies or run expensive setup in every test file pay that cost once per test. test/install runs setup SQL once before the entire test suite, and all regular tests share the resulting database state. This can dramatically speed up test suites that install extensions or load fixtures. Place SQL files in test/install/ to enable; auto-detects based on file presence.
make results now refuses to run when tests are failing (detected via regression.diffs). Prevents accidentally blessing incorrect output as the new expected results. Enabled by default; disable with PGXNTOOL_ENABLE_VERIFY_RESULTS=no.
${ARRAY[@]:-0} is a syntax error in bash 3.2; replaced with ${#ARRAY[@]}.
Shell scripts now use !/usr/bin/env bash.
The unique database naming introduced in 1.1.0 was ineffective because base.mk added --dbname=$(REGRESS_DBNAME) to REGRESS_OPTS while PGXS also appends --dbname=$(CONTRIB_TESTDB). The second --dbname caused pg_regress to create a contrib_regression database that collided across projects. Fixed by overriding CONTRIB_TESTDB after include $(PGXS) instead.
The exception handler for uninstall_extension() now correctly catches
no_data_found (P0002) instead of undefined_object (42704). Empty upgrade
files are now treated as valid no-op upgrades for version bumps. Added
ON_ERROR_STOP=1 to run_pgtle_sql() so psql errors propagate correctly.
Tests now use a unique database name based on the project name and a hash of the current directory. This prevents test conflicts when running tests for multiple projects in parallel.
New update-setup-files.sh script handles merging changes to files initially
copied by setup.sh (.gitignore, test/deps.sql). After running make
pgxntool-sync, the script performs a 3-way merge if both you and pgxntool have
modified the same file, using git’s native conflict markers for resolution.
Prior to this fix, distributions with multiple extensions or extensions with
versions different from the PGXN distribution version were completely broken.
Extension versions are now correctly read from each .control file’s
default_version instead of using META.json’s distribution version.
New make pgtle target generates pg_tle registration SQL for extensions.
Supports pg_tle version ranges (1.0.0-1.4.0, 1.4.0-1.5.0, 1.5.0+) with
appropriate API calls for each range. See README for usage.
The tag and rmtag targets now create/delete git tags instead of branches.
As part of this change, you will want to review the changes to test/deps.sql.
By default, if asciidoctor or asciidoc exists on the system, any files in doc/ that end in .adoc or .asciidoc will be processed to html.
See the README for full details.
If a test input file changes we certainly need to re-run tests.
Paul Norman #3
Having the tap stuff in deps.sql was confusing because it was also loaded by setup.sql. Just let setup.sql handle it, as that’s what most people should probably do. At some point we’ll probably need a way to over-ride this though…
This is necessary because some install targets are generated and would not necessarily be on the filesystem when we installed. This also prevents installing leftover cruft from old versions.