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
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ results/
regression.diffs
regression.out

# Generated sql/ directory for test/build
# Created by make test-build. See README.asc for details.
test/build/sql/

# Auto-generated schedule file for test/install
# Created by make when test/install/*.sql files exist.
test/install/schedule

# Misc
tmp/
.DS_Store
Expand Down
78 changes: 0 additions & 78 deletions pgxntool/.claude/commands/commit.md

This file was deleted.

19 changes: 0 additions & 19 deletions pgxntool/.claude/settings.json

This file was deleted.

14 changes: 11 additions & 3 deletions pgxntool/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Scope of This File

The guidance in this CLAUDE.md applies to pgxntool's own source files and provides
recommended best practices for projects using pgxntool. However, any agent working in
an extension project should always defer to that project's own CLAUDE.md and
instructions over anything stated here.

## Git Commit Guidelines

**IMPORTANT**: When creating commit messages, do not attribute commits to yourself (Claude). Commit messages should reflect the work being done without AI attribution in the message body. The standard Co-Authored-By trailer is acceptable.
Expand Down Expand Up @@ -181,9 +188,10 @@ When tests fail, examine the diff output carefully. The actual test output in `t
- Validates repo is clean before tagging

### Subtree Sync Support
- `make pgxntool-sync` pulls latest release
- Multiple sync targets: release, stable, local variants
- Uses `git subtree pull --squash`
- `make pgxntool-sync` pulls the latest release (the `release` tag) from the canonical repo
- `pgxntool/pgxntool-sync.sh [<repo> [<ref>]]` does the work and can be run without make
- `make pgxntool-sync-<name>` pulls from the `pgxntool-sync-<name>` variable (`<repo> <ref>`)
- Uses `git subtree pull --squash`, then `update-setup-files.sh` for a 3-way merge of copied files
- Requires clean repo (no uncommitted changes)

### pg_tle Support
Expand Down
90 changes: 86 additions & 4 deletions pgxntool/HISTORY.asc
Original file line number Diff line number Diff line change
@@ -1,10 +1,90 @@
2.0.3
-----
== Fix pgxntool-sync remote, and make it runnable without make
`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.

2.0.2
-----
== Fix parse_control_file corrupting values with trailing comments
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.

2.0.1
-----
== Improve bash compatibility (specifically for Mac OS)
Mac OS uses the (very old) bash 3.2 as the default shell; fix a few compatibility bugs.

2.0.0
-----
== Remove .source file support
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 (`TEST__SOURCE__*`), 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.

== Add test-build for pre-test validation
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.

== Add test/install for one-time test setup
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.

== Add verify-results safeguard for make results
`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`.

== Fix bash 3.2 compatibility and shebang portability
`${#ARRAY[@]:-0}` is a syntax error in bash 3.2; replaced with `${#ARRAY[@]}`.
Shell scripts now use `#!/usr/bin/env bash`.

1.1.2
-----
== Fix double --dbname bug that defeated unique test database names
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.

1.1.1
-----
== Fix pg_tle exception handler and empty upgrade files
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.

1.1.0
-----
== Use unique database names for tests
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.

== Add 3-way merge support for setup files after pgxntool-sync
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.

1.0.0
-----
== Fix broken multi-extension support
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.
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.

== Add pg_tle support
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.
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.

== Use git tags for distribution versioning
The `tag` and `rmtag` targets now create/delete git tags instead of branches.
Expand All @@ -16,7 +96,9 @@ The `--load-language` option was removed from `pg_regress` in 13.
As part of this change, you will want to review the changes to test/deps.sql.

=== Support asciidoc documentation targets
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.
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.

=== Support 9.2
Expand Down Expand Up @@ -44,7 +126,7 @@ VERSION is defined by PGXS itself, so trying to use it causes problems.
Old code didn't deal with the lack of a . that can appear in a 10+ version.

0.1.10
------
-----
### Remove invalid `git subtree pull` options

0.1.9
Expand Down
24 changes: 0 additions & 24 deletions pgxntool/JSON.sh.LICENCE

This file was deleted.

Loading
Loading