From c19d30ee0ac5fd0124ffa82b4302a781892de0da Mon Sep 17 00:00:00 2001 From: Mark Milligan Date: Wed, 30 Mar 2022 07:44:31 -0500 Subject: [PATCH 1/2] chore: add psql instructions for Coder for Docker --- setup/coder-for-docker/local.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/setup/coder-for-docker/local.md b/setup/coder-for-docker/local.md index 0b5745644..fc71bf00c 100644 --- a/setup/coder-for-docker/local.md +++ b/setup/coder-for-docker/local.md @@ -208,6 +208,23 @@ following flags with the `docker run` command: If you're interested in using Docker as a workspace provider, please see our [deployment instructions](../../admin/workspace-providers/deployment/docker.md). +## Accessing the local PostgreSQL database + +If you would like to type in SQL queries interactively with the local PostgreSQL +database using the `psql` [terminal-based +front-end](https://www.postgresql.org/docs/13/app-psql.html), follow these +steps. + +Run `docker ps` to get the name of the Coder container. + +```sh +docker exec -it /bin/bash +``` + +```sh +psql --username=coder --host=0.0.0.0 --port=5433 --dbname=postgres +``` + ## Known issues Currently, Coder for Docker does not support: From de668a4b3b210eead8e2438d9ceffc377f2248be Mon Sep 17 00:00:00 2001 From: Eric Paulsen Date: Wed, 30 Mar 2022 09:08:11 -0500 Subject: [PATCH 2/2] chore: edit text & formatting --- setup/coder-for-docker/local.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/setup/coder-for-docker/local.md b/setup/coder-for-docker/local.md index fc71bf00c..2f0411c1c 100644 --- a/setup/coder-for-docker/local.md +++ b/setup/coder-for-docker/local.md @@ -210,20 +210,17 @@ If you're interested in using Docker as a workspace provider, please see our ## Accessing the local PostgreSQL database -If you would like to type in SQL queries interactively with the local PostgreSQL -database using the `psql` [terminal-based +To query the local PostgreSQL database using the `psql` [terminal-based front-end](https://www.postgresql.org/docs/13/app-psql.html), follow these steps. -Run `docker ps` to get the name of the Coder container. +1. Run `docker ps` to get the name of the Coder container. -```sh -docker exec -it /bin/bash -``` +1. Exec into the Coder container and connect to the database. -```sh -psql --username=coder --host=0.0.0.0 --port=5433 --dbname=postgres -``` + ```console + docker exec -it psql --username=coder --host=0.0.0.0 --port=5433 --dbname=postgres + ``` ## Known issues