fastread homefastrread library fastread menu

PostgreSQL : Rename a User

Tutorial by:      Date: 2016-04-19 23:30:02

❰ Previous Next ❱

This PostgreSQL tutorial explains how to rename a user in PostgreSQL with syntax and examples.

Description

The ALTER USER statement is used to rename a user in the PostgreSQL database.

Syntax

The syntax to rename a user using the ALTER USER statement in PostgreSQL is:

ALTER USER user_name

  RENAME TO new_name;

Parameters or Arguments

user_name

The name of the user to rename in the PostgreSQL database.

new_name

The new name to assign to the user.

Note

  • You can not rename the current session user. If you wish to rename the current session user, you will need to logout and then login as a different user to run the ALTER USER statement.

Example

Let's look at how to rename a user in PostgreSQL using the ALTER USER statement.

For example:

ALTER USER fastread.aitechtonic

  RENAME TO totn;

In this example, the ALTER USER statement would rename the user called fastread.aitechtonic to totn in the PostgreSQL database.

 

❰ Previous Next ❱


PostgreSQL

Submit Your Thought, Tutorial, Articls etc.

Submit Your Information India's Number one online promotion website