How to Connect PostgreSQL to a Backend When They Are in Different IDX Projects

Hello

If I have postgres in one idx project, and my backend in another idx, how to connect my backend to my pg database? I tried making public port 5432 in postgres idx

Curious about this use case. Is this for development?

What is the advantage of connecting 2 idx instances like this as opposed to launching postgres db directly in the backend workspace that you’re trying to connect from?