Category Archives: postgres

How to restore a postgres database with a different owner

To restore a database and have the tables owned by a different user use the pg_dump command like this: as root user run: su postgres pg_dump -Fc database_name > database_name.dump exit Now you can restore using pg_restore. createuser -P -s … Continue reading

Posted in postgres | Comments Off on How to restore a postgres database with a different owner

Error: pg_config executable not found.

This bogus error can be frustrating to figure out. I have figured it out a few times over the years and always forget how I solved it because it only occurs on a server where you have never deployed a … Continue reading

Posted in Linux, postgres, python | Comments Off on Error: pg_config executable not found.

Use UTF-8 as the default encoding for postgres databases

To avoid problems with encoding if you forget to change from the default SQL_ASCII when you create a database, I find it is best to set the default to UTF-8 whenever I set up a new server. One less thing … Continue reading

Posted in postgres | Comments Off on Use UTF-8 as the default encoding for postgres databases

Best Practices for shared postgres hosting

This is what you are looking for: http://wiki.postgresql.org/wiki/Shared_Database_Hosting

Posted in Linux, postgres | Comments Off on Best Practices for shared postgres hosting