PostgreSQL Notes

General commands

ANALYZE and VACUUM

Activate autovacuum in postgresql.conf

Change encoding of 'template1'

On a UTF-8 setup you might still require a LATIN1 database template because your supplier tells you so. Most likely you don't want this - but if you do, that's what you need to do:

Migrating a database to another encoding

Your only option is to dump the database and recreate it. Here is what I did when I had to migrate from UTF-8 to LATIN1. First dupm the database from a shell

Then move the database and recreate it with the correct settings

Then restore the dump, setting the client to the old encoding

If everything is successful drop the backup of the database