/other/

postgres notes

2013-07-28 21:15:34

-- use postgres in command line
psql -d postgres -U postgres
CREATE DATABASE databasename;

-- by the way: to unzip zip use: 
-- unzip zipName.zip -d folderPath or unzip zipName.zip

-- import database form file to database
postgres=# \i /home/szalek/data/dataBaseName.tar

-- create copy of database
postgres=# CREATE DATABASE copy1 WITH TEMPLATE oldDataBase OWNER szalek;

-- list of database
postgres=# \list

-- rename database
postgres=# ALTER DATABASE copy1 RENAME TO copy2;