Quantcast
Channel: Other – Michał Szałkowski – Blog
Viewing all articles
Browse latest Browse all 125

postgres notes

$
0
0
-- 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;

Viewing all articles
Browse latest Browse all 125

Trending Articles