Database Creation in DB levelConnect to PostgreSQL : First, connect to your PostgreSQL server using a client application or command-line tool like ‘psql’.
psql -U username -d postgres
Create Database :Once connected, you can create a new database using the ‘CREATE DATABASE’ SQL command.
CREATE DATABASE dbname;
Grant Privileges :
Optionally, you can grant privileges to specific users on the newly created database. For example,
to grant all privileges to a user named ‘user1’.Exit: Once you've created the database and granted privileges, if necessary, you can exit the PostgreSQL prompt. (Type \q) « Previous (Database creation from bash) |