Switch role after connecting to database in PostgreSQL

In this article, we will see how to Switch role after connecting to database in PostgreSQL with examples.

We can switch or change the current use/role as active using set command.
Continue reading Switch role after connecting to database in PostgreSQL

How to create PostgreSQL User with superuser privileges

In this article, we will see how to create PostgreSQL User with superuser privileges by two ways.

Create PostgreSQL User/Role with superuser privileges by using either of following methods:
1. Create User/Role first then assign superuser privilege.
2. Create User/Role with superuser privileges.

Continue reading How to create PostgreSQL User with superuser privileges

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

How to find list of users in Azure PostgreSQL

In this article, we will see how to find list of users in Azure PostgreSQL. We can get list of users by querying against pg_user view and by expanding Login/Role Groups in pgadmin tool.

Find list of users in Azure PostgreSQL: Continue reading How to find list of users in Azure PostgreSQL

How to create user in Azure PostgreSQL

In this article, we will see how to create user in Azure PostgreSQL server.

We are going to create user in Azure MySQL server by using two ways.

1. Using GUI methods.
2. Using Create user statement on psql tool or pgadmin tool.

1. Create User in Azure PostgreSQL Database using Create User command:

Continue reading How to create user in Azure PostgreSQL

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 rename role or user in PostgreSQL

In this article, we will see how to rename role or user in PostgreSQL.

The alter role/user statement is used to rename role or user in PostgreSQL.

Syntax:

ALTER ROLE/USER ROLE_NAME RENAME TO NEW_NAME;

Continue reading How to rename role or user in PostgreSQL

What is the difference between SESSION_USER and CURRENT_USER in PostgreSQL

In this article, we will see the difference between SESSION_USER and CURRENT_USER in PostgreSQL.

Difference between SESSION_USER and CURRENT_USER in PostgreSQL:
SESSION_USER is the role name of the role that is connected to the database.
Continue reading What is the difference between SESSION_USER and CURRENT_USER in PostgreSQL