Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nishhtg
Regular Visitor

Problems on creating a new dataset with Power BI's REST API

 

error for me , getting 202 instead of 201 for dataset creation.

 

this is something wrong with the conenction string for postgres.

as it very difficult to understand and findout exactly what needs to be the structure for a postgres datasource.

 

i have tried various patterns for the connection string with no luck.

 

 "datasources":[
      {
         "name":"postgres",
         "connectionString":"Provider=ODBC;Data Source=postgresql://localhost/postgres?user=postgres&password=12345&ssl=prefer;Initial Catalog = postgres; Cube=Model;"
      }
   ]

 

   "datasources":[

      {

         "name":"postgres",

         "connectionString":"Server=localhost;Port=5432;Database=postgres;User Id=postgres;Password=root;"

      }

   ]

}

 

 

datasources":[

      {

         "name":"postgres",

         "connectionString":"Data Source=postgresql://localhost/Postgres?user=other&password=secret;Initial Catalog=Postgres;Cube=Model"

                                OR

                                Data Source=jdbcSmiley Tongueostgresql://localhost/Postgres?user=fred&password=secret&ssl=true

                               

      }

   ]

 

Also, the terms CUBE and INITIAL CATALOG, PROVIDER these keys have very less info available on the net for postgres connection string. A detailed explanation for postgres connection string would be helpful here.

1 ACCEPTED SOLUTION
v-micsh-msft
Employee
Employee

Check the following thread for the connection string for postgres SQL:

PostgreSQL connection through On-premise Data Gateway

Quoted:

"

for ODBC connection to postgres you need to get installed ODBC driver for postgres;i am using PostgresSQL Unicode(x64).

After that you have 2 options:

1) create user DSN via ODBC data source administrator (C:\Windows\System32\odbcad32.exe). In that case the connection string for ODBC data source is "dsn=dsn_name" where dsn_name represents the user dsn created via tool above

2) alternative option for connection string is: driver={PostgreSQL Unicode(x64)};server=server_name;port=5432;database=db_name

where server_name represents a server name or its IP, db_name is name of database.

For using on-premise gateway you need to use ODBC connection to postgress on power bi desktop. Then you need to configure data sources using ODBC the same way on on-premise gateway.

"

Regards,

Michael

View solution in original post

1 REPLY 1
v-micsh-msft
Employee
Employee

Check the following thread for the connection string for postgres SQL:

PostgreSQL connection through On-premise Data Gateway

Quoted:

"

for ODBC connection to postgres you need to get installed ODBC driver for postgres;i am using PostgresSQL Unicode(x64).

After that you have 2 options:

1) create user DSN via ODBC data source administrator (C:\Windows\System32\odbcad32.exe). In that case the connection string for ODBC data source is "dsn=dsn_name" where dsn_name represents the user dsn created via tool above

2) alternative option for connection string is: driver={PostgreSQL Unicode(x64)};server=server_name;port=5432;database=db_name

where server_name represents a server name or its IP, db_name is name of database.

For using on-premise gateway you need to use ODBC connection to postgress on power bi desktop. Then you need to configure data sources using ODBC the same way on on-premise gateway.

"

Regards,

Michael

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.