In this post, I am sharing some important and basic command for Database Administrator of PostgreSQL.
Check version of PostgreSQL:
Create database using the script:
CREATE DATABASE Database_Name WITH OWNER User_Name;
Change owner of the database:
ALTER DATABASE Database_Name OWNER TO User_Name;
Create a full copy of the database with structure and data:
CREATE DATABASE NewDB WITH TEMPLATE OldDB;
Create database User using the script:
CREATE USER Anvesh WITH password 'testPassword';
Change password of the User:
ALTER USER postgres WITH PASSWORD 'temproot';
Upgrade existing User to Superuser:
ALTER USER TestUser WITH SUPERUSER;
Reload PostgreSQL configuration file:
Rotate PostgreSQL Log file:
Find Postgres server start time:
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.