I concluded that only the 1st 8 characters of the password is used for authentification when encrypted password is used. This doesn't happen password is set as plain text.
Wondering if any of you guys out there encounter this bug.
Did you check Postgresql bugs database? Why don't you fill a bug report on their site?