Skip to content

Commit

Permalink
Configure postgres with pg_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Romanow committed Oct 3, 2024
1 parent 1b7677d commit 748458c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM postgres:15

RUN apt-get update && \
apt-get install curl -y && \
curl -L -o /tmp/pg_profile.tar.gz https://github.com/zubkov-andrei/pg_profile/releases/download/4.7/pg_profile--4.7.tar.gz && \
tar -xf /tmp/pg_profile.tar.gz -C $(pg_config --sharedir)/extension \
3 changes: 2 additions & 1 deletion postgres/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: "3.9"
services:
postgres:
image: postgres:15
build: .
image: romanowalex/postgres:15-pg_profile
container_name: postgres
environment:
POSTGRES_USER: postgres
Expand Down
12 changes: 12 additions & 0 deletions postgres/postgres/20-configure-pg-profile.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- file: 20-configure-pg-profile.sql
CREATE EXTENSION dblink;
CREATE EXTENSION pg_stat_statements;
CREATE EXTENSION pg_profile;

ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';
ALTER SYSTEM SET track_activities = on;
ALTER SYSTEM SET track_counts = on;
ALTER SYSTEM SET track_io_timing = on;
ALTER SYSTEM SET track_wal_io_timing = on;
ALTER SYSTEM SET track_functions = 'all';
SELECT PG_RELOAD_CONF();

0 comments on commit 748458c

Please sign in to comment.