From 2069aac59c81c14ea7fd39a5c6e39b43218c6487 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 12 Feb 2021 16:27:03 +0100 Subject: [PATCH] Add 2 helpers for adding extension more easily --- src/root/usr/bin/create_extension | 5 +++++ src/root/usr/bin/load_pg_library | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 src/root/usr/bin/create_extension create mode 100644 src/root/usr/bin/load_pg_library diff --git a/src/root/usr/bin/create_extension b/src/root/usr/bin/create_extension new file mode 100644 index 00000000..f46b7411 --- /dev/null +++ b/src/root/usr/bin/create_extension @@ -0,0 +1,5 @@ +#!/bin/sh +EXT=$1 +mkdir -p ~/postgresql-init +echo "echo 'CREATE EXTENSION IF NOT EXISTS ${EXT};' | psql" > ~/postgresql-init/enable_${EXT}.sh + diff --git a/src/root/usr/bin/load_pg_library b/src/root/usr/bin/load_pg_library new file mode 100644 index 00000000..8ffe3bb8 --- /dev/null +++ b/src/root/usr/bin/load_pg_library @@ -0,0 +1,4 @@ +#!/bin/sh +LIB=$1 +mkdir -p ~/postgresql-cfg +echo "shared_preload_libraries='${LIB}'" > ~/postgresql-cfg/${LIB}.conf