Sunday, February 7, 2021

postgresql from treminal

 
In this blog we will explain many ways that help us to control postgresql from terminal
 
 
Connect To Postgresql 
psql postgres
  

restore dump backup database in postgresql
pg_restore -U postgres -d coffee -1 /home/user_name/Downloads/db_backup_name.dump

or
pg_dump DB_name  > /home/user/Desktop/db_backup_name.dump

 

restore ZIP backup database in postgresql 

curl -X POST -F 'master_pwd=1234' -F 'name=DB_name' -F 'backup_format=zip' -o /home/user/Desktop/back_up.zip http://localhost:8069/web/database/backup 

 

Create new database

CREATE DATABASE DB_name;


Connect one database
psql db_name user_name

 

Delete database 

DROP DATABASE DB_name


Rename database
ALTER DATABASE DB_name RENAME TO DB_new_name

 

Copy database
CREATE DATABASE New_DB_name
WITH TEMPLATE Existed_DB_name;


No comments:

Post a Comment

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...