I have installed a ReDash on a Google Cloud VM, using an image from this post https://redash.io/help/open-source/setup#gce

I’m curious if it is possible to access the internal database that ReDash uses. I’d like to be able to change certain pieces of information at scale, for instance, changing the table referenced by a large number of queries.

Is this possible? What RDBMS does ReDash use? Postgres?
What is the database called? Is it immediately accessible by SSH’ing onto the server?

Cheers,
JP

1 Like

Postgres runs as a Docker container on your VM. You can connect to it using the following command:

$ cd /opt/redash
$ docker-compose run --rm postgres psql postgres://...

Replace postgres://... with the connection string from /opt/redash/env file (the REDASH_DATABASE_URL value).

1 Like

To be completely explicit –

  • cat /opt/redash/env
  • create a new postgres datasource in redash with the following extracted from above:
    REDASH_DATABASE_URL=postgresql://[USERNAME]:[PASSWORD]@[HOSTNAME]/[DATABASENAME]
  • I kept default port 5432.

You won’t need to run docker-compose if it’s already running.

1 Like

is there anything that needs to be updated in the postgres configurations ?
i connected the postgres as a redash datasource but i can’t connect to it
could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

What settings did you use to connect? If you entered 127.0.0.1 as the host for the postgres that would fail because the API server is not running the database. You’ll need to enter the IP address for the container that runs the db.

2 Likes

How do we get the IP address of the other container?
Is there such a thing?

Got the answer to this.
Rather than any IP, just use the name of postgres service as given in the docker-compose
The same can also be found in the value of REDASH_DATABASE_URL variable in env file at “/opt/redash/env”

1 Like