Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPG-375: Add script to relocate extensions #860

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions postgresql-containers/bin/relocate-extensions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

PG_EXTENSIONS_DIR=/usr/pgsql-${PG_VERSION}/share/extension
PG_LIB_DIR=/usr/pgsql-${PG_VERSION}/lib

PGDATA_EXTENSIONS_DIR=/pgdata/extension/${PG_VERSION}/usr/pgsql-${PG_VERSION}/share/extension
PGDATA_LIB_DIR=/pgdata/extension/${PG_VERSION}/usr/pgsql-${PG_VERSION}/lib

mkdir -p ${PGDATA_EXTENSIONS_DIR}
mkdir -p ${PGDATA_LIB_DIR}

cp -r ${PG_EXTENSIONS_DIR}/* ${PGDATA_EXTENSIONS_DIR}/
cp -r ${PG_LIB_DIR}/* ${PGDATA_LIB_DIR}/
4 changes: 3 additions & 1 deletion postgresql-containers/build/postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ENV PATH="${PGROOT}/bin:${PATH}"
RUN set -ex; \
mkdir -p /opt/crunchy/bin /opt/crunchy/conf /pgdata /pgwal /pgconf /backrestrepo /tablespaces; \
chown -R postgres:postgres /opt/crunchy /var/lib/pgsql \
/pgdata /pgwal /pgconf /backrestrepo /tablespaces; \
/pgdata /pgwal /pgconf /backrestrepo /tablespaces /usr/pgsql-${PG_MAJOR//.}; \
chmod -R g=u /opt/crunchy /var/lib/pgsql \
/pgdata /pgwal /pgconf /backrestrepo /tablespaces

Expand All @@ -188,6 +188,8 @@ RUN set -ex; \
/etc/pgbackrest.conf

COPY conf/pgbackrest-repo/pgbackrest.conf /etc/pgbackrest.conf
COPY bin/relocate-extensions.sh /usr/local/bin/relocate-extensions.sh

RUN echo "huge_pages = off" >> ${PGROOT}/share/postgresql.conf.sample

# remove the default spool directory so that pgBackRest does not attempt to look there when
Expand Down
Loading