Skip to content

Commit 14f253e

Browse files
NikolaySclaude
andcommitted
Fix PostgreSQL configuration by running pg_ctl as postgres user
- Use --user postgres flag for docker exec when running pg_ctl commands - This resolves the "pg_ctl: cannot be run as root" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 17c73b8 commit 14f253e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
echo "PostgreSQL container: $CONTAINER_ID"
5656
5757
# Stop PostgreSQL to modify configuration
58-
docker exec $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -m fast stop || true
58+
docker exec --user postgres $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -m fast stop || true
5959
6060
# Configure shared_preload_libraries
6161
docker exec $CONTAINER_ID bash -c "echo \"shared_preload_libraries = 'pg_stat_statements'\" >> /var/lib/postgresql/data/postgresql.conf"
@@ -65,7 +65,7 @@ jobs:
6565
docker exec $CONTAINER_ID bash -c "echo 'local all all trust' >> /var/lib/postgresql/data/pg_hba.conf"
6666
6767
# Restart PostgreSQL
68-
docker exec $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/data/logfile start
68+
docker exec --user postgres $CONTAINER_ID pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/data/logfile start
6969
7070
# Wait for PostgreSQL to be ready after restart
7171
sleep 5

0 commit comments

Comments
 (0)