Skip to content

Commit e566132

Browse files
committed
fix(plpgsql-check): add missing upgrade path files between versions
Generate empty SQL files for version-to-version upgrade paths to satisfy PostgreSQL extension upgrade requirements.
1 parent f10a98f commit e566132

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nix/ext/plpgsql-check.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ buildEnv {
110110
ls -la $out/lib/*${postgresql.dlSuffix} || true
111111
exit 1
112112
fi
113+
114+
# Create empty upgrade files between consecutive versions
115+
# plpgsql_check ships without upgrade scripts - extensions are backward-compatible
116+
previous_version=""
117+
for ver in ${lib.concatStringsSep " " versions}; do
118+
if [[ -n "$previous_version" ]]; then
119+
touch $out/share/postgresql/extension/${pname}--''${previous_version}--''${ver}.sql
120+
fi
121+
previous_version=$ver
122+
done
113123
'';
114124

115125
passthru = {

0 commit comments

Comments
 (0)