Skip to content

Commit 32163be

Browse files
committed
feat: parse and handle oropledb-16 in start-server
1 parent 292327e commit 32163be

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@
454454
--subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \
455455
--subst-var-by 'PSQL_CONF_FILE' $out/etc/postgresql/postgresql.conf \
456456
--subst-var-by 'PSQL16_BINDIR' '${basePackages.psql_16.bin}' \
457+
--subst-var-by 'PSQLORIOLEDB16_BINDIR' '${basePackages.psql_oriole-16.bin}' \
457458
--subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \
458459
--subst-var-by 'READREPL_CONF_FILE' "$out/etc/postgresql-custom/read-replica.conf" \
459460
--subst-var-by 'LOGGING_CONF_FILE' "$out/etc/postgresql-custom/logging.conf" \

nix/tools/run-server.sh.in

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
# shellcheck shell=bash
33
[ ! -z "$DEBUG" ] && set -x
4-
# first argument should be '15' or '16' for the version
4+
55
if [ "$1" == "15" ]; then
66
echo "Starting server for PSQL 15"
77
PSQL15=@PSQL15_BINDIR@
@@ -61,5 +61,17 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \
6161
-e "\$a\\
6262
session_preload_libraries = 'supautils'" \
6363
"$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf"
64+
65+
remove_config_items() {
66+
if [ "$1" == "orioledb-16" ]; then
67+
# Remove items from supautils.conf
68+
sed -i '/supautils.privileged_extensions/d' "$DATDIR/supautils.conf"
69+
70+
# Remove items from postgresql.conf
71+
sed -i 's/ timescaledb,//g' "$DATDIR/postgresql.conf"
72+
sed -i 's/ timescaledb,//g; s/ vector,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf"
73+
fi
74+
}
75+
remove_config_items "$1"
6476
export GRN_PLUGINS_DIR=$GROONGA/lib/groonga/plugins
6577
postgres --config-file="$DATDIR/postgresql.conf" -p "$PORTNO" -D "$DATDIR" -k /tmp

0 commit comments

Comments
 (0)