This guide walks you through executing the following SQL command inside a PostgreSQL Docker container:
DELETE FROM session WHERE session_id = 'id_visitor';
DELETE FROM website_event WHERE session_id = 'id_visitor';Before making any changes, itβs always a good idea to back up your data.
docker exec -t umami-db pg_dumpall --clean --if-exists --username=umami | gzip > "/path/to/backup/dump.sql.gz"Replace /path/to/backup/dump.sql.gz with your desired local backup path.
Make sure the umami user exists and has sufficient privileges.
Run the following command to list all running containers:
docker psLook for the one using the postgres image. Note the container name or container ID (e.g. umami-db).
Use docker exec to open an interactive terminal to the container and connect to the database:
docker exec -it <container_name_or_id> psql -U <username> -d <database>Replace the placeholders:
<container_name_or_id>β your PostgreSQL container name or ID<username>β typicallyumami<database>β your database name (e.g.umami)
Example:
docker exec -it umami-db psql -U umami -d umamiOnce inside the psql shell, run:
DELETE FROM session WHERE session_id = 'id_visitor';
DELETE FROM website_event WHERE session_id = 'id_visitor';Replace 'id_visitor' with the actual session ID you want to remove.
β If successful, it will return:
DELETE 1
(or another number depending on how many rows were affected)