Connect Power BI to retool PostgreSQL database

Hi, I'm a new user, so I ask you to have a little patience.

We use Power BI extensively for reporting or Power Query in Excel to reprocess data. We are building our first app in Retool and will use the Retool database in PostgreSQL. Now it would be very convenient to access the database through Power BI or Excel, but I am encountering some issues. In Power BI service, I am setting the parameters that you see in the image below, where, of course, instead of 'PostgreSQL Connection String,' I have put the string that I find inside Retool.

It's not working, and it's asking me to check the username and password. Could you help me with this? Before asking Microsoft support, I'd like to be sure about the parameters I've set.


Finally it works.

Info here: PostgreSQL: Documentation: 15: 34.1. Database Connection Control Functions

User name, password and server link are inside the "Postgres Connection URL": it is not meant to be used as it is, you need to split the strings.


I'd just like to clarify in case someone else comes along and has a small bit of trouble following.

Let's say your Postgres Connection URL is...


The info entered into Power BI would be as follows:

Database: production
User: user1
Password: 123456789

Data Source Settings:
Encrypt connections - off

OP's post solution was spot on, I just stumbled a bit following it and thought I'd add in case others did as well.

Thanks again for the solution!!


Hi Jonathan,
thanks for adding the details, it will be helpful for sure since I spent quite a lot on this. I still have to understand how to make it work in Locker Studio (it seems it requires to use SSL, I'm not familiar with it) but that is not a priority since I mainly use PBI.

this is the connection string format:


so you get the proprieties you described.

I'll add only this detail, I got this in the end "database_name?sslmode=require" and so you have to delete every thing from the question mark to get the database name that in this example is "database_name".

1 Like