Postgres on ubuntu

1) Switch to postgres
$ sudo -i -u postgres
2) Create a db
$ createdb mydatabase
3) Import pk file to db
$ psql mydatabase < /home/user/Desktop/
4) Switch to mydatabase db from postgres
$ psql mydatabase
5) Export a table data to csv format
$ COPY customer_billing TO ‘/tmp/customer_billinginfo’ DELIMITER ‘,’ CSV HEADER;
Note: The following command are in sequence, should be executed one after another.