How to connect to a postgres db deployed as part of the preview env

Hi - I have a postgres db deployed as part of a preview env and I want to connect to it locally to ensure that it has executed the initdb config … I tried to do portforward but it does not work for preview env…
Appreciate if there is a way to connect to db running in preview env

Hey @ketanadkar! Welcome to the Okteto community and thanks for posting this question. Preview environments aren’t meant to be connected to for dev debugging like dev environments are. If you want to debug your Postgres DB, is there something preventing you from creating a dev environment and doing that with the same code you have in the preview environment? It should be fairly simple:

  1. Just check out into the branch you created the preview environment for.
  2. Run okteto up on the Postgres container.

Let me know if you still have any doubts, I’m happy to assist you more!