How do I configure a read-only user for PostgreSQL in Power BI to maintain security

0 votes
How do I configure a read-only user for PostgreSQL in Power BI to maintain security?

I need to connect Power BI to a PostgreSQL database while ensuring that users have read-only access to maintain security. What is the best way to configure a read-only user in PostgreSQL for Power BI? What permissions and settings should be applied to prevent unauthorized modifications while allowing data access for reporting?
11 hours ago in Power BI by Evanjalin
• 15,820 points
10 views

1 answer to this question.

0 votes

To configure a read-only user for PostgreSQL in Power BI securely:

Create a Read-Only User

CREATE ROLE powerbi_readonly WITH LOGIN PASSWORD 'strongpassword';

Grant Read-Only Access

GRANT CONNECT ON DATABASE your_database TO powerbi_readonly;
GRANT USAGE ON SCHEMA public TO powerbi_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO powerbi_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO powerbi_readonly;

Revoke Write Permissions

REVOKE INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public FROM powerbi_read

Connect Power BI

  • Use Get Data → PostgreSQL Database in Power BI.
  • Enter powerbi_readonly credentials.

Enhance Security (Optional)

  • Restrict system table access:
REVOKE ALL ON pg_stat_activity FROM powerbi_readonly;

Enable SSL encryption for secure connections.

answered 11 hours ago by anonymous
• 15,820 points

Related Questions In Power BI

0 votes
1 answer

I have a web API with basic authorisation and username and password. How do i connect to it in Power BI?

Hey, @There, I found your query is quite ...READ MORE

answered Oct 29, 2020 in Power BI by Gitika
• 65,770 points
3,884 views
0 votes
0 answers

How can I create a read-only link to a Power BI report with predefined slicer filters applied?

How can I create a read-only link ...READ MORE

Dec 6, 2024 in Power BI by Evanjalin
• 15,820 points
106 views
0 votes
1 answer

How can I create a read-only link to a Power BI report with predefined slicer filters applied?

Create View-Only Link of Power BI Report ...READ MORE

answered Dec 12, 2024 in Power BI by pooja
• 14,980 points
108 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,497 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,130 points
2,855 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,633 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Yes using Power BI REST API to ...READ MORE

answered Sep 18, 2018 in Power BI by Kalgi
• 52,350 points
1,771 views
0 votes
1 answer

Why am I unable to set refresh for a web-based anonymous connection in Power BI Server, and how can I resolve it?

Scheduled refresh for web-based data sources that ...READ MORE

answered 12 hours ago in Power BI by anonymous
• 15,820 points
15 views
0 votes
1 answer

How do I prevent my app from redirecting to Power BI when embedding a protected report in a React application?

To ensure that your React app will ...READ MORE

answered 11 hours ago in Power BI by anonymous
• 15,820 points
15 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP