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

Add pg_store_plans #529

Merged
merged 1 commit into from
Dec 5, 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
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
"""