Skip to content

Commit 0e283e6

Browse files
committed
feat: working orioledb-17
1 parent fa05170 commit 0e283e6

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

flake.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@
154154
x != ./nix/ext/pgvector.nix &&
155155
x != ./nix/ext/plv8.nix &&
156156
x != ./nix/ext/postgis.nix &&
157-
x != ./nix/ext/pgrouting.nix
157+
x != ./nix/ext/pgrouting.nix &&
158+
x != ./nix/ext/pg_jsonschema.nix &&
159+
x != ./nix/ext/pg_graphql.nix &&
160+
x != ./nix/ext/rum.nix &&
161+
x != ./nix/ext/wal2json.nix
158162
) ourExtensions;
159163

160164
orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ];
@@ -466,7 +470,7 @@
466470
--subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \
467471
--subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \
468472
--subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \
469-
--subst-var-by 'PSQLORIOLEDB16_BINDIR' '${basePackages.psql_orioledb-16.bin}' \
473+
--subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \
470474
--subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \
471475
--subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \
472476
--subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \

nix/ext/orioledb.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
77
owner = "orioledb";
88
repo = "orioledb";
99
rev = "2861cf9091a92bcabbbbf1f4d15f8edff480fea1";
10-
sha256 = "";
10+
sha256 = "sha256-VVOHOIhQSQ824vfZlptOj1Gcu6Jg80amjRp7CpUOq6s=";
1111
};
1212
version = "patches17_3";
1313
buildInputs = [ curl libkrb5 postgresql python3 openssl ];
14-
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=31";
14+
buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=3";
1515
installPhase = ''
1616
runHook preInstall
1717
mkdir -p $out/{lib,share/postgresql/extension}

nix/ext/pgaudit.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#adapted from https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/ext/pgaudit.nix
33
let
44
source = {
5+
"17" = {
6+
version = "17.0";
7+
hash = "sha256-3ksq09wiudQPuBQI3dhEQi8IkXKLVIsPFgBnwLiicro=";
8+
};
59
"16" = {
610
version = "16.0";
711
hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc=";

nix/postgresql/generic.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let
5151
inherit version;
5252
pname = pname + lib.optionalString jitSupport "-jit";
5353

54-
src = if (builtins.match "17_*" version != null) then
54+
src = if (builtins.match "[0-9][0-9]_.*" version != null) then
5555
fetchurl {
5656
url = "https://github.com/orioledb/postgres/archive/refs/tags/patches${version}.tar.gz";
5757
inherit hash;
@@ -64,7 +64,7 @@ let
6464

6565
hardeningEnable = lib.optionals (!stdenv'.cc.isClang) [ "pie" ];
6666

67-
outputs = [ "out" "lib" "doc" "man" ];
67+
outputs = [ "out" "lib" ];
6868
setOutputFlags = false; # $out retains configureFlags :-/
6969

7070
buildInputs = [
@@ -83,7 +83,7 @@ let
8383
++ lib.optionals gssSupport [ libkrb5 ]
8484
++ lib.optionals stdenv'.isLinux [ linux-pam ]
8585
++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ]
86-
++ lib.optionals (builtins.match "16_.*" version != null) [
86+
++ lib.optionals (builtins.match "[0-9][0-9]_.*" version != null) [
8787
perl bison flex docbook_xsl docbook_xml_dtd_45 docbook_xsl_ns libxslt
8888
];
8989

@@ -97,7 +97,7 @@ let
9797

9898
separateDebugInfo = true;
9999

100-
buildFlags = [ "world" ];
100+
buildFlags = [ "world-bin" ];
101101

102102
# Makes cross-compiling work when xml2-config can't be executed on the host.
103103
# Fixed upstream in https://github.com/postgres/postgres/commit/0bc8cebdb889368abdf224aeac8bc197fe4c9ae6
@@ -138,7 +138,7 @@ let
138138
(if atLeast "13" then ./patches/socketdir-in-run-13+.patch else ./patches/socketdir-in-run.patch)
139139
];
140140

141-
installTargets = [ "install-world" ];
141+
installTargets = [ "install-world-bin" ];
142142

143143
postPatch = ''
144144
# Hardcode the path to pgxs so pg_config returns the path in $out
@@ -288,7 +288,7 @@ let
288288
paths = f pkgs ++ [
289289
postgresql
290290
postgresql.lib
291-
postgresql.man # in case user installs this into environment
291+
#TODO RM postgresql.man # in case user installs this into environment
292292
];
293293
nativeBuildInputs = [ makeWrapper ];
294294

nix/postgresql/orioledb-17.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import ./generic.nix {
22
version = "17_3";
3-
hash = "";
3+
hash = "sha256-LOlST80eU+Wmmcmo4WHGwOClYZ+bBahyltsGYeKWCU4=";
44
}

nix/tools/run-server.sh.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ remove_config_items() {
6868
if [ "$1" == "orioledb-17" ]; then
6969
# Remove items from postgresql.conf
7070
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
71+
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
72+
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
7173
sed -i 's/ timescaledb,//g; s/ vector,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf"
7274
fi
7375
}

0 commit comments

Comments
 (0)