![]() Postgresql=# CREATE USER WASI WITH PASSWORD 'xi8s0R4' CREATEDB In this section, we will create a user named WASI who has the create database permission. ![]() Output: 1.4 Create User With Create Databases Permission Using Psql In the attributes section of the below output, we can see the password expiry date is mentioned. Postgresql=# CREATE USER MOHAN WITH PASSWORD 'qw63R2' VALID UNTIL '' In this example, we will create a user named MOHAN by providing the password expiry date. Output: 1.3 Create User With Password Expiry Date Using Psql In the below output we can see the DEV user is created. Postgresql=# CREATE USER DEV WITH PASSWORD 'we43Y2' In this section, we will create a user named DEV by supplying the password. Output: 1.2 Create User With Password Using Psql The user has been created without a password and we can see the list of users using the \du command in the below figure. In the following example, we are creating a user named RAVI without providing the password. We can create a PostgreSQL DB user without supplying the password. ![]() 1.1 Create User Without Password Using Psql Now let us see the various ways to create a user by using multiple options. Postgresql=# CREATE USER User_name option ] The following is the syntax and the option of CREATE USER command. It provides various options that we can use per requirement. To create a PostgreSQL Database user, we can use the psql CREATE USER command. In this section of the PostgreSQL tutorial, we will see the different ways to create a PostgreSQL user. All database users are globalĪnd can access the objects across the PostgreSQL cluster. The superuser is capable of creating a new user in the PostgreSQL database or the one who has create role permission. PostgreSQL creates the default superuser Postgres during the installation time and grantsĪll privileges with the grant option. ![]() The user name should not be starting with pg_. Users are separated and should be unique. In PostgreSQL, the database users and the Operating system PostgreSQL users are used to performing various operations in the database starting from the development to an administrator. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |