Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
database:postgresql [2016/03/24 16:02] – [Commands] tmadedatabase:postgresql [2018/03/31 10:06] (current) – [RESTORE] tmade
Line 94: Line 94:
  
   psql -f dumpfile postgres               #"postgres" is the owner of the db!   psql -f dumpfile postgres               #"postgres" is the owner of the db!
-   
-To restore a DB (created with "pg_dump") you have: 
- 
-  dropdb databasename 
-  createdb databasename 
-   
-Afterwards you have to invoke: 
- 
-  pg_restore -d databasename databasename.dump 
-  psql dbname < infile.sql 
- 
 ==== POINT IN TIME RECOVERY ==== ==== POINT IN TIME RECOVERY ====
  
Line 125: Line 114:
   CREATE DATABASE test OWNER test   CREATE DATABASE test OWNER test
  
 +==== Roles and Grants ====
  
- +To add role "CREATEDB" to user test: 
-ALTER USER db001 CREATEDB; +   
-sudo -u postgres psql -c 'alter user db001 with createdb' postgres+  ALTER USER test CREATEDB; 
 +or 
 +  sudo -u postgres psql -c 'alter user test with createdb' postgres
  
  
database/postgresql.txt · Last modified: 2018/03/31 10:06 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki