Friday, May 1, 2015

Postgresql: porting database

Porting vCenter database into existing Postgres database.




psql>
create database vcdb if not exist;
create user vc with password 'vmware';
grant all PRIVILEGES ON DATABASE vcdb to vc;

psql -U vc -d vcdb -f VCDBback.backup


Example


postgres=# create database vc;
CREATE DATABASE
postgres=# create user vc with password 'mypass!2ft';
CREATE ROLE
postgres=# grant all PRIVILEGES ON DATABASE vc to vc;
GRANT
vc=# grant postgres to vc; 
GRANT ROLE

postgres=# \c vc vc                
You are now connected to database "vc" as user "vc".
vc=> \i VCDBback.backup

No comments:

Post a Comment