Skip to content

Commit

Permalink
Add pg_repack extension
Browse files Browse the repository at this point in the history
Our solutions engineers and some customers would like to have this
extension available. We are using a commit instead of a tagged release
because pg_repack maintainers have not tagged a release which contains
the commit that allows us to run pg_repack as a non-superuser.

Closes: neondatabase/cloud#18890
Link: reorg/pg_repack#431 (comment)
Signed-off-by: Tristan Partin <[email protected]>
  • Loading branch information
tristan957 committed Dec 11, 2024
1 parent ef233e9 commit d2ca581
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions compute/compute-node.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,29 @@ RUN case "${PG_VERSION}" in \
make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) install && \
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_mooncake.control

#########################################################################################
#
# Layer "pg_repack"
# compile pg_repack extension
#
#########################################################################################

FROM build-deps AS pg-repack-build
ARG PG_VERSION
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/

# pg_repack has not created a new tag with following commit, yet.
ENV PG_REPACK_VERSION=85b64c6d4f599b2988343c4e7121acab505c9006
ENV PATH="/usr/local/pgsql/bin/:$PATH"

RUN git clone --depth 1 https://github.com/reorg/pg_repack.git pg_repack-src && \
cd pg_repack-src && \
git checkout "${PG_REPACK_VERSION}" && \
make -j $(getconf _NPROCESSORS_ONLN) && \
make -j $(getconf _NPROCESSORS_ONLN) install && \
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_repack.control


#########################################################################################
#
# Layer "neon-pg-ext-build"
Expand Down Expand Up @@ -1213,6 +1236,7 @@ COPY --from=pg-anon-pg-build /usr/local/pgsql/ /usr/local/pgsql/
COPY --from=pg-ivm-build /usr/local/pgsql/ /usr/local/pgsql/
COPY --from=pg-partman-build /usr/local/pgsql/ /usr/local/pgsql/
COPY --from=pg-mooncake-build /usr/local/pgsql/ /usr/local/pgsql/
COPY --from=pg-repack-build /usr/local/pgsql/ /usr/local/pgsql/
COPY pgxn/ pgxn/

RUN make -j $(getconf _NPROCESSORS_ONLN) \
Expand Down

0 comments on commit d2ca581

Please sign in to comment.