Adds encoding option to PostgreSQL (not gui). Closes #371