Repository navigation
Switch master to the stable pseudo-version and restore the shipped 0.2.0 script - #8
Merged
Merged
Conversation
Set default_version and the META.json versions to `stable`, so editing the source regenerates the gitignored sql/trunklet-format--stable.sql instead of a released version's install script. Restore sql/trunklet-format--0.2.0.sql to the script that shipped as 0.2.0 (identical to the PGXN 0.2.0 release), and add the 0.2.0--stable update script, which brings a 0.2.0 install up to the current source. Updating from 0.2.0 needs extension_drop created first, because 0.2.0 did not require it; HISTORY.asc and README.md say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The drop command registered by the install and update scripts calls trunklet.template_language__remove() with ignore_missing_functions, which trunklet 0.3.3 added, and the update script uses _trunklet._language_function__create(), added in 0.3.0. Raise both trunklet prereqs to 0.3.3, and say in HISTORY.asc and README.md that updating from 0.2.0 needs trunklet updated first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trunklet has no update script from 0.2.0, so ALTER EXTENSION trunklet UPDATE only works from trunklet 0.2.1 or later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switches master to the
stablepseudo-version (default_versionin the control file, and the distribution and extension versions inMETA.in.json/META.json), so source edits regenerate the gitignoredsql/trunklet-format--stable.sqlinstead of a released version's install script. It also restoressql/trunklet-format--0.2.0.sqlto the script that actually shipped as 0.2.0, and addssql/trunklet-format--0.2.0--stable.sqlto bring a 0.2.0 install up to the current source.Updating from 0.2.0 needs extension_drop and trunklet >= 0.3.3 first, on PostgreSQL 12 or later. 0.2.0 required only trunklet. The current version also requires extension_drop, so
ALTER EXTENSION "trunklet-format" UPDATEfails withrequired extension "extension_drop" is not installeduntil you runCREATE EXTENSION extension_drop CASCADE;. The 0.2.0-to-stable update requires trunklet >= 0.3.3, because the registered drop command usestemplate_language__remove(ignore_missing_functions), new in 0.3.3. trunklet 0.2.0 has no update script to 0.2.1 or later, so users on trunklet 0.2.0 must drop and recreate trunklet, which also drops trunklet-format and any trunklet data. This PR raises both trunklet prereqs inMETA.in.jsonto 0.3.3, andHISTORY.ascandREADME.mddescribe these steps.Before changing anything, the update script fails with
trunklet >= 0.3.3 required; found <version>if the installed trunklet is older than 0.3.3.The 0.2.0 install script
The stacked #3 adds a
sql/trunklet-format--0.2.0.sqlgenerated from the current source, which differs from what shipped as 0.2.0 in 153 lines (it includes later commits such as "Add support for dropping the extension"). This PR replaces it with the shipped script, taken from the0.2.0branch, which is byte-identical to the PGXN 0.2.0 release.The update script
It registers the drop command that 0.2.0 lacked (via
extension_drop__add), then replaces theformatlanguage's stored function bodies and recreates its two functions the same waytrunklet.template_language__add()does.Residual risk: this writes trunklet's private
_trunklettables and calls its private_trunklet._language_function__create(), because trunklet has no public API to replace a language. Removing and re-adding the language would fail on stored templates, or with cascade delete them. If trunklet changes those internals, this script has to follow.Checked by hand on PostgreSQL 12 and 17. A real 0.2.0 install (shipped 0.2.0 control file and script) was updated with
ALTER EXTENSION UPDATEand compared against a freshstableinstall. These were identical: member objects,pg_get_functiondefoutput, comments, ACLs and owners of every member function, the_trunklet.languagerow, the registered extension_drop command, and the recorded required extensions. With the function replacement removed from the update script, the same comparison shows differences. After the update, a template stored before it still processes, the new optional-parameter syntax works, andDROP EXTENSIONremoves the language. Committed update-path testing arrives in #4.make testdoesn't pass on this branch alone, because the repo'sMakefiledoesn't work with pgxntool 2.4.0 yet (make installfails with "will not overwrite just-created"). The stacked #3 fixes that.🤖 Generated with Claude Code