Skip to content
Draft
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
4 changes: 2 additions & 2 deletions META.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
"X_comment": "Valid keys for 'prereqs' are configure, build, runtime, or test.",
"X_comment": "Valid keys for 'requires' are requires, recommends, suggests, or conflicts.",
"X_comment": "Requires event_triggers, introduced in 9.3",
"X_comment": "cat_tools: requires extension support, added in 0.2.1",
"X_comment": "cat_tools: requires cat_tools.routine__parse_arg_types_text, added in 0.3.0",
"prereqs": {

"build": {
"requires": {
"PostgreSQL": "9.3.0",
"cat_tools": "0.2.1"
"cat_tools": "0.3.0"
}
},
"runtime": {
Expand Down
4 changes: 2 additions & 2 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
"X_comment": "Valid keys for 'prereqs' are configure, build, runtime, or test.",
"X_comment": "Valid keys for 'requires' are requires, recommends, suggests, or conflicts.",
"X_comment": "Requires event_triggers, introduced in 9.3",
"X_comment": "cat_tools: requires extension support, added in 0.2.1",
"X_comment": "cat_tools: requires cat_tools.routine__parse_arg_types_text, added in 0.3.0",
"prereqs": {

"build": {
"requires": {
"PostgreSQL": "9.3.0",
"cat_tools": "0.2.1"
"cat_tools": "0.3.0"
}
},
"runtime": {
Expand Down
29 changes: 28 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,34 @@ $(DESTDIR)$datadir)/extension/extension_drop_test.control:
deps: cat_tools
install: deps

# extension_drop.sql calls cat_tools.routine__parse_arg_types_text(), which only
# exists starting at cat_tools 0.3.0. PGXN's published cat_tools listing is
# stuck at 0.2.1 from 2017 (the old decibel/cat_tools distribution) and was
# never updated for the Postgres-Extensions/cat_tools fork; `pgxn install
# cat_tools` therefore installs an ancient 0.2.1 lacking the function we need
# (and carrying a pre-omit_column-fix catalog query that breaks on PG12+).
# 0.3.0 itself has not been tagged/published to PGXN yet -- only 0.2.2/0.2.3
# are there, and even 0.2.3 predates this function. So PGXN isn't a usable
# install source right now.
#
# Building straight from a git ref instead of PGXN is a supported way to
# depend on an extension here, not just a one-off hack -- reach for it again
# whenever a dependency's real state has moved ahead of what's tagged on
# PGXN. What IS temporary is depending on cat_tools this way at all:
# CAT_TOOLS_GIT_REF tracks cat_tools' `master` directly rather than a pinned
# commit, since the function we need doesn't exist on any tagged release, so
# there's nothing more stable to pin to yet. Once 0.3.0 is tagged and
# published to PGXN, revert *this target* to a plain
# `pgxn install 'cat_tools>=0.3.0' --sudo`; leave the git-source mechanism
# itself in place for reuse if this happens again.
CAT_TOOLS_GIT_REF = master
CAT_TOOLS_BUILD_DIR = tmp/cat_tools-build

.PHONY: cat_tools
cat_tools: $(DESTDIR)$(datadir)/extension/cat_tools.control
$(DESTDIR)$(datadir)/extension/cat_tools.control:
pgxn install 'cat_tools>=0.2.1' --sudo
rm -rf $(CAT_TOOLS_BUILD_DIR)
git clone https://github.com/Postgres-Extensions/cat_tools.git $(CAT_TOOLS_BUILD_DIR)
cd $(CAT_TOOLS_BUILD_DIR) && git checkout $(CAT_TOOLS_GIT_REF)
$(MAKE) -C $(CAT_TOOLS_BUILD_DIR) install PG_CONFIG=$(PG_CONFIG) DESTDIR=$(DESTDIR)
rm -rf $(CAT_TOOLS_BUILD_DIR)
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Run custom commands when an extension is dropped. By default, `DROP
EXTENSION` simply drops all the objects the extension owns; this lets you
register additional SQL to run when a given extension is dropped.

Requires [cat_tools](https://pgxn.org/dist/cat_tools/) >= 0.2.1.
Requires [cat_tools](https://github.com/Postgres-Extensions/cat_tools) >= 0.3.0.
Note: as of this writing, cat_tools 0.3.0 has not been tagged/published to
PGXN yet, so the `cat_tools` build dependency is temporarily installed
straight from its `master` branch rather than via `pgxn install` -- see the
`Makefile`. This will revert to a plain `pgxn install` once 0.3.0 is
published; building from a git ref is itself a supported fallback for this
kind of gap, not a one-off hack.

## Functions

Expand Down