1

With powerbi desktop I can easily connect with postgres database on server(192.168.1.5:32100) running on a port and a database_name. But doing the same with PowerBI on premise gateway I could not connect when adding a data source on gateway setting(gateway cluster). Below screenshot for reference. The first picture is of PowerBI desktop and the second one is on gateway settings. Is it something with the port?If yes I was able to connect on PowerBI desktop, if no then is there any way or am I missing something. Thanks in advance for the help. enter image description here enter image description here

2 Answers 2

2

Method 1

  1. Install the Npgsql provider on the server that's hosting the data gateway (https://www.nuget.org/packages/Npgsql/4.0.2)

  2. Reboot the server

Method 2

Connecting to PostgreSQL database using ODBC Connector

  1. Using the below link download the latest version of ODBC connection for PostgreSQL database and Install https://www.postgresql.org/ftp/odbc/versions/msi/
  2. After installation completed, open the Power BI Desktop and choose Get Data
  3. Instead of selecting postgresql database, this time we will choose ODBC. Select ODBC and click on Connect
  4. A window will open and select “None” as Datasource Name (DSN)
  5. In the same window, we have connection string. Here we have to provide proper connection details to connect postgresql database. We won’t be able to click “OK” until we have provided the correct connection string.
  6. To get the proper connection string use this link. https://www.connectionstrings.com/postgresql-odbc-driver-psqlodbc/
  7. We have given the below connection string and able to click on “OK” Connection String: Driver={PostgreSQL ANSI(x64)}; Server=localhost; Port=6433; Database=foodmart
  8. Enter the credentials and select the tables
  9. Create a report and publish in Power BI service
  10. Login to Power BI service and open settings of a report dataset
  11. Expand gateway connection and now we can see that gateway is enabled and it is connected local gateway
  12. Expand the data source credentials and enter the database credentials
  13. Now go to datasets and click on refresh icon of the dataset
  14. Dataset will get refreshed using the gateway

Should now be able to use the PostgreSQL data source type when creating the data source in Power BI Service.

Thanks,

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the support. I've already done that it doesn't work. Do you mean installing npgsql service on the server thats hosting the data gateway or the actual server that holds the data? Currently I did on the one that is hosting the only data gateway(actual data contains on another server)
Hi, You have to install the driver on the data gateway installed machine. And check that machine has access to the database server. (database connectivity)
Hi Now i understood the issue. Please find the edited answer.
Thank you for the reply. Can you please upvote my answer..
0

I cannot comment because I don't have 50 reputation. I downloaded the psqlodbc_16_00_0000-x64.zip file from the link above and opened it. I get a dialog from Windows saying

Windows protected your PC
Windows Defender SmartScreen prevented an unrecognised app from starting. Running this app might put your PC at risk.
App: psqlodbc_x64.msi
Published: Unknown publisher

Windows Defender dialog

I've never received a dialog like this before. Is the link above safe, or has it (or my PC) been compromised?

I also downloaded an earlier file psqlodbc_13_02_0000-x64.zip and ran it. It gave no Windows Defender dialog warning.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.