Connect to pg database and delete some stuff from the shell #4088
-
Hi there, I want to connect to the pg shell and delete some data entries manually. If there is a solution using pgAdmin it can also help. I'm running locally using docker. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Assuming the postgres container is alreasdy running, you can open a bash shell prompt with:
From there, you can type psql to run a SQL REPL and execute whatever queries you need. Make sure to connect with the right credentials, they are located in
If you want to connect with a more visual tool from outside the container, you'll need to map the Postgres port (5432) to your host machine. This is usually done by adding them to the docker compose config file postgres:
+ ports:
+ - "5432:5432"
build: More explanations on port mapping in the docs. |
Beta Was this translation helpful? Give feedback.
Assuming the postgres container is alreasdy running, you can open a bash shell prompt with:
From there, you can type psql to run a SQL REPL and execute whatever queries you need. Make sure to connect with the right credentials, they are located in
.envs/.local/.postgres
, which should be in the container environment:If you want to connect with a more visual tool from outside the container, you'll need to map the Postgres port (5432) to your host machine. This is usually done by adding them to the docker compose config file
local.yml
:More ex…