Sourcegraph DocsSourcegraph Docs
Changelog↗
Theme
  1. Docs
  2. self-hosted
  3. how-to
  4. run-psql

How to run postgres commands

This document will take you through how to run postgres queries in the main database for each deployment type.

Prerequisites

  • This document assumes that you are the administrator and have access to your Sourcegraph instance

Kubernetes

  1. Exec into the database to run Postgres queries using kubectl exec -ti PGSQL-Container-Name -- psql -U sg

Docker Compose

  1. Exec into the database to run Postgres queries using docker container exec -it pgsql psql -U sg

On this page

  1. How to run postgres commands

    1. Prerequisites
    1. Kubernetes
    1. Docker Compose

Edit this page on GitHub
View as Markdown