Thursday, 10 September 2009

How to convert RPM to DEB

Use alien to convert *.rpm files to *.deb files:
$ sudo apt-get install alien
$ sudo alien -d pgDesigner-1.2.10.src.rpm

Tuesday, 8 September 2009

The best way to duplicate Postgres database

I had to copy Postgres database from a development server to the live server and I found this command line based method the most convenient:

$ pg_dump -h -U username --clean --oids --verbose mydatabase 2>dump.log | psql -h -U username mylivedatabase>>dump.log 2>&1
$ tail -f dump.log

I couldn't do this in a 'single transaction' mode because I don't have superuser privileges.
So I filtered all informative an error messages to follow the process. Database (schem + data) dump with redirection right into another databse proved to be the quickest as no disk space was required for dump files.