Skip to content

Commit c2312c3

Browse files
committed
chore: add a migration for orioledb activation by default
1 parent 376f8d9 commit c2312c3

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- migrate:up
2+
do $$
3+
begin
4+
if not exists (select 1 from pg_extension where extname = 'orioledb') then
5+
create extension if not exists orioledb;
6+
end if;
7+
end $$;
8+
9+
-- migrate:down
10+
drop extension if exists orioledb;

nix/tools/run-server.sh.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \
6464
session_preload_libraries = 'supautils'" \
6565
"$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf"
6666

67-
remove_config_items() {
67+
orioledb_config_items() {
6868
if [ "$1" == "orioledb-17" ]; then
6969
# Remove items from postgresql.conf
7070
sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf"
7171
#as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present
7272
sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf"
7373
sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "$DATDIR/supautils.conf"
74+
sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATADIR/postgresql.conf"
75+
echo "default_table_access_method = 'orioledb'" >> "$DATADIR/postgresql.conf"
76+
7477
fi
7578
}
76-
remove_config_items "$1"
79+
orioledb_config_items "$1"
7780
if [ "$CURRENT_SYSTEM" = "aarch64-darwin" ]; then
7881
echo "NOTE: using aarch64-darwin system"
7982
sed -i '' 's/ pg_net,//g' "$DATDIR/postgresql.conf"

0 commit comments

Comments
 (0)