Skip to content

Commit 39f9a0e

Browse files
authored
fix(pgmq): add missing helper function in migration script (#1825)
pg_regress tests are failing because the helper function pgmq._extension_exists() is missing in the 1.5.0 to 1.5.1 migration script. This change adds the missing function to the migration script.
1 parent 6e3ae5b commit 39f9a0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nix/ext/pgmq.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ let
6060
echo "default_version = '${version}'"
6161
cat $out/share/postgresql/extension/${pname}--${version}.control
6262
} > $out/share/postgresql/extension/${pname}.control
63+
cat >> sql/pgmq--1.5.0--1.5.1.sql <<EOF
64+
65+
CREATE FUNCTION pgmq._extension_exists(extension_name TEXT)
66+
RETURNS BOOLEAN
67+
LANGUAGE SQL
68+
AS \$\$
69+
SELECT EXISTS (
70+
SELECT 1
71+
FROM pg_extension
72+
WHERE extname = extension_name
73+
)
74+
\$\$;
75+
EOF
6376
cp sql/*.sql $out/share/postgresql/extension
6477
fi
6578

0 commit comments

Comments
 (0)