Skip to content

Commit

Permalink
Add pg_store_plans (#529)
Browse files Browse the repository at this point in the history
Co-authored-by: Evan Stanton <[email protected]>
  • Loading branch information
EvanHStanton and Evan Stanton authored Dec 5, 2023
1 parent a4ffc24 commit 55ec625
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
38 changes: 38 additions & 0 deletions contrib/pg_store_plans/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ARG PG_VERSION=15
FROM quay.io/coredb/c-builder:pg${PG_VERSION}
USER root

# Extension build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libreadline-dev \
zlib1g-dev \
flex bison \
libxml2-dev \
libxslt-dev \
libssl-dev \
libxml2-utils \
xsltproc \
ccache

# Clone repository
RUN git clone https://github.com/postgres/postgres.git

# Use argument to specify PostgreSQL release
ARG PG_RELEASE=REL_15_3

# Configure and build PostgreSQL
RUN cd postgres && \
git fetch origin ${PG_RELEASE} && \
git checkout ${PG_RELEASE} && \
./configure && \
cd contrib && \
git clone https://github.com/ossc-db/pg_store_plans.git

ARG RELEASE=1.7

# Build extension
RUN cd postgres/contrib/pg_store_plans && \
git fetch origin ${RELEASE} && \
git checkout ${RELEASE} && \
make
20 changes: 20 additions & 0 deletions contrib/pg_store_plans/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[extension]
name = "pg_store_plans"
version = "1.7.0"
repository = "https://github.com/ossc-db/pg_store_plans"
license = "Copyright"
description = "Track plan statistics of all SQL statements executed."
documentation = "https://ossc-db.github.io/pg_store_plans/"
categories = ["metrics"]
preload_libraries = ["pg_store_plans"]

[build]
postgres_version = "15"
platform = "linux/amd64"
dockerfile = "Dockerfile"
install_command = """
cd postgres/contrib/pg_store_plans && make install
set -x
mv /usr/local/pgsql/share/extension/* /usr/share/postgresql/15/extension
mv /usr/local/pgsql/lib/* /usr/lib/postgresql/15/lib
"""

0 comments on commit 55ec625

Please sign in to comment.