Skip to content

Commit 748458c

Browse files
committed
Configure postgres with pg_profile
1 parent 1b7677d commit 748458c

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

postgres/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM postgres:15
2+
3+
RUN apt-get update && \
4+
apt-get install curl -y && \
5+
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 && \
6+
tar -xf /tmp/pg_profile.tar.gz -C $(pg_config --sharedir)/extension \

postgres/docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: "3.9"
22
services:
33
postgres:
4-
image: postgres:15
4+
build: .
5+
image: romanowalex/postgres:15-pg_profile
56
container_name: postgres
67
environment:
78
POSTGRES_USER: postgres
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- file: 20-configure-pg-profile.sql
2+
CREATE EXTENSION dblink;
3+
CREATE EXTENSION pg_stat_statements;
4+
CREATE EXTENSION pg_profile;
5+
6+
ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';
7+
ALTER SYSTEM SET track_activities = on;
8+
ALTER SYSTEM SET track_counts = on;
9+
ALTER SYSTEM SET track_io_timing = on;
10+
ALTER SYSTEM SET track_wal_io_timing = on;
11+
ALTER SYSTEM SET track_functions = 'all';
12+
SELECT PG_RELOAD_CONF();

0 commit comments

Comments
 (0)