How to reset password for user in Azure PostgreSQL server

In this article, we will see how to reset password for user in Azure PostgreSQL server.

We can reset password for a user in Azure PostgreSQL same as do for standard PostgreSQL server. We have two methods:
1. GUI i.e. using pgadmin tool
2. By running alter user/role command.

Continue reading How to reset password for user in Azure PostgreSQL server

PostgreSQL pgadmin error Unable to connect to Server

PostgreSQL pgadmin error Unable to connect to Server:

FATAL: Invalid username specified. Please check the Username and retry connection.
The Username should be in format.

PostgreSQL pgadmin error Unable to connect to Server
Continue reading PostgreSQL pgadmin error Unable to connect to Server

How to connect to Azure PostgreSQL Server

In this article, we will see how to connect to Azure PostgreSQL Server from pgadmin or psql.

1. Steps to connect to Azure PostgreSQL server from pgadmin:

1. Connect to Azure portal, then click on Azure PostgreSQL Server. From left menu click on connection security. Then, provide name for your firewall, IP address as show below. Then click on Save.
Continue reading How to connect to Azure PostgreSQL Server

psql: error: FATAL: role is not permitted to log in

I have received following error when trying to connect to PostgreSQL server.

psql: error: FATAL: role is not permitted to log in

psql error FATAL role is not permitted to log in
Continue reading psql: error: FATAL: role is not permitted to log in

How to find the number of active database connections in PostgreSQL

In this article, we will see how to find the number of active database connections in PostgreSQL. We can find number active connections to entire PostgreSQL server and individual databases using pg_stat_database view.

1. Find the number of active total connections in PostgreSQL Server.
Continue reading How to find the number of active database connections in PostgreSQL

How to create a read-only user in PostgreSQL

If we only grant CONNECT to a database, the user can connect but has no other privileges. We have to grant USAGE on namespaces (schemas) and SELECT on tables and views individually like so:

1. Create User.

create user r2admin with password 'admin@123';

Continue reading How to create a read-only user in PostgreSQL