Skip to content

Commit 83bbb70

Browse files
committed
update pgmq update
1 parent fbbba39 commit 83bbb70

2 files changed

Lines changed: 34 additions & 35 deletions

File tree

nix/ext/pgmq/default.nix

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ let
3636
inherit pname version;
3737
buildInputs = [ postgresql ];
3838
src = fetchFromGitHub {
39-
owner = "tembo-io";
39+
owner = "pgmq";
4040
repo = pname;
4141
rev = "v${version}";
4242
inherit hash;
4343
};
4444

45+
# Only apply patches to versions that still need them
46+
# Check if the drop_queue patch is still needed for your versions
4547
patches = lib.optionals (version == latestVersion) [
4648
./0001-fix-replace-drop_queue-function-if-exists.patch
4749
];
@@ -63,25 +65,14 @@ let
6365
-e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \
6466
${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control
6567
66-
# For the latest version, create default control file and symlink and copy SQL upgrade scripts
68+
# For the latest version, create default control file and copy SQL upgrade scripts
6769
if [[ "${version}" == "${latestVersion}" ]]; then
6870
{
6971
echo "default_version = '${version}'"
7072
cat $out/share/postgresql/extension/${pname}--${version}.control
7173
} > $out/share/postgresql/extension/${pname}.control
72-
cat >> sql/pgmq--1.5.0--1.5.1.sql <<EOF
73-
74-
CREATE FUNCTION pgmq._extension_exists(extension_name TEXT)
75-
RETURNS BOOLEAN
76-
LANGUAGE SQL
77-
AS \$\$
78-
SELECT EXISTS (
79-
SELECT 1
80-
FROM pg_extension
81-
WHERE extname = extension_name
82-
)
83-
\$\$;
84-
EOF
74+
75+
# Copy all SQL upgrade scripts
8576
cp sql/*.sql $out/share/postgresql/extension
8677
fi
8778
@@ -90,8 +81,7 @@ let
9081

9182
meta = with lib; {
9283
description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.";
93-
homepage = "https://github.com/tembo-io/pgmq";
94-
maintainers = with maintainers; [ olirice ];
84+
homepage = "https://pgmq.github.io/pgmq/";
9585
inherit (postgresql.meta) platforms;
9686
license = licenses.postgresql;
9787
};
@@ -116,4 +106,4 @@ buildEnv {
116106
else
117107
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
118108
};
119-
}
109+
}

nix/ext/versions.json

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
"17"
359359
],
360360
"hash": "sha256-9St/ESPiFq2NiPKqbwHLwkIyATKUkOGxFcUrWgT+Iqo="
361-
}
361+
}
362362
},
363363
"pg_partman": {
364364
"5.3.1": {
@@ -370,21 +370,31 @@
370370
"hash": "sha256-LK+z/0puUuNLz2ah/SDaxxyLS/On/cmCBhKNwTLa7Pk="
371371
}
372372
},
373-
"pgmq": {
374-
"1.4.4": {
375-
"postgresql": [
376-
"15"
377-
],
378-
"hash": "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw="
379-
},
380-
"1.5.1": {
381-
"postgresql": [
382-
"15",
383-
"17"
384-
],
385-
"hash": "sha256-IU+i6ONPwtgsFKdzya6E+222ualR66gkbb0lDr+7Rb8="
386-
}
373+
"pgmq": {
374+
"1.10.0": {
375+
"postgresql": [
376+
"15",
377+
"17"
378+
],
379+
"hash": "sha256-sNOFr3tiZATFBvRBm4pSsn8YR62zqN06VBOBnvdXgts="
380+
},
381+
"1.11.0": {
382+
"postgresql": [
383+
"15",
384+
"17",
385+
"18"
386+
],
387+
"hash": "sha256-fJWINP7Dvc79blpfYbGfTEKZtcA/S8KAjmX5uPhmXBM="
387388
},
389+
"1.11.1": {
390+
"postgresql": [
391+
"15",
392+
"17",
393+
"18"
394+
],
395+
"hash": "sha256-BPOrQ7HcgTaTJIRzWUCG3iJN3mUjwIxa/wPxvJ1l4o4="
396+
}
397+
},
388398
"pgroonga": {
389399
"3.0.7": {
390400
"postgresql": [
@@ -409,7 +419,6 @@
409419
"hash": "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="
410420
}
411421
},
412-
413422
"pgsodium": {
414423
"3.0.4": {
415424
"postgresql": [
@@ -880,4 +889,4 @@
880889
"hash": "sha256-+QoACPCKiFfuT2lJfSUmgfzC5MXf75KpSoc2PzPxKyM="
881890
}
882891
}
883-
}
892+
}

0 commit comments

Comments
 (0)