Makefile: generic SED marker processing via awk; sql/.gitignore: wildcard for versioned files#14
Merged
jnasbyupgrade merged 3 commits intomasterfrom Apr 20, 2026
Merged
Conversation
… version; sql/.gitignore: use wildcard - Replace per-version ifeq/sed blocks in the .sql build recipe with a define (_apply_version_seds) that applies 9.x hacks via safesed variables and handles PG 10+ generically via a single POSIX awk invocation. - Add rules to build EXTENSION_VERSION_FILES via a .sql.in intermediate, overriding control.mk's direct-copy rule so SED markers are applied. - Replace hard-coded versioned file list in sql/.gitignore with a wildcard (cat_tools--*.sql) plus !-exceptions for historical files with no .sql.in. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Write to $@.tmp first, then atomically mv to $@, so a failed pipeline never leaves a partial file that appears complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rsion>.sql Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
sql/.gitignore: Replace hard-coded per-version entries withcat_tools--*.sqlwildcard +!-exceptions for historical files that have no.sql.insource (0.1.*and0.2.0--0.2.1). New versioned files no longer need manual.gitignoreupdates.Makefile: Replace per-versionifeq/safesedblocks in the build recipe with a reusabledefine _apply_version_sedsthat:safesedhack (temporary, to be dropped with 9.x support)Makefile: Add rules to buildEXTENSION_VERSION_FILESvia a.sql.inintermediate, overridingcontrol.mk's direct-copy rule so version-conditional SED markers (-- SED: REQUIRES N!/-- SED: PRIOR TO N!) are applied to the current version's install script.Test plan
makesucceeds on PG 9.3, 9.5, and a PG 10+ versionsql/cat_tools--<version>.sqlhas correct SED substitutions applied🤖 Generated with Claude Code