How can I set up the Ad Hoc Query feature & access the Postgres DB in a remote deployment?

In the airflow_db connection (a default connection created when the deployment is created), change the Conn Type to Postgres and add the following connection information:

host: {host}-pgbouncer
schema: {host}-metadata
login: {host}_airflow

For example, if your deployment name was planetary-magnitude-8405, the connection information would be the following:

host: planetary-magnitude-8405-pgbouncer
schema: planetary-magnitude-8405-metadata
login: planetary-magnitude-8405_airflow

The last piece of this connection is the password which can be provided by the Astronomer team on request.

1 Like