postgres

Upload PostgreSQL not working, change the encoding may help

20 Jul , 2015  

When we upload and restore the backup into new postgresql server, sometimes we facing problem because encoding.
To solve this, we can use UTF-8 :

1
update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = 'your-database';

,

postgres

Create user in PostgreSQL interactive

27 Dec , 2014  

To create new user in PostgreSQL interactively :

1
2
sudo -i -u postgres
createuser <user-name> --interactive -P

postgres

Setup pgpass in Windows

20 Oct , 2014  

To setup pgpass in windows, please go to :

1
C:\Users\<your-user>\AppData\Roaming

Create “postgresql” folder and create pgpass.conf file inside.

1
localhost:5432:*:postgres:<your-password>