Skip to content

Commit

Permalink
dev/postgres: log statements (#1175)
Browse files Browse the repository at this point in the history
Enable statement logging in local PostgreSQL docker containers launched with `make run-docker-postgres`.

This is very helpful if trying to understand exactly what SQL queries are being made, and fiddly to enable.
  • Loading branch information
alxndrsn authored Sep 4, 2024
1 parent ef63c74 commit f5e8f6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ lint: node_version

.PHONY: run-docker-postgres
run-docker-postgres: stop-docker-postgres
docker start odk-postgres14 || (docker run -d --name odk-postgres14 -p 5432:5432 -e POSTGRES_PASSWORD=odktest postgres:14.10-alpine && sleep 5 && node lib/bin/create-docker-databases.js)
docker start odk-postgres14 || (\
docker run -d --name odk-postgres14 -p 5432:5432 -e POSTGRES_PASSWORD=odktest postgres:14.10-alpine \
postgres -c log_statement=all -c log_destination=stderr -c log_parameter_max_length=80 \
&& sleep 5 \
&& node lib/bin/create-docker-databases.js \
)

.PHONY: stop-docker-postgres
stop-docker-postgres:
Expand Down

0 comments on commit f5e8f6e

Please sign in to comment.