Hi Rajesh,
I don't know what error you are getting. Though you can use below workaround to login and change the password.
Step 1: Open pg_hba.conf file and modify md5 to trust
Step 2: reload the cluster (/opt/PostgreSQL/9.2/bin/pg_ctl -D ../data/ reload)
Step 3: Connect to the database, it should not ask for password:
bash-4.1$ ./psql -p 5435 postgres
psql.bin (9.2.7)
Type "help" for help.
postgres=# \password postgres;
Enter new password:
Enter it again:
postgres=# \q
bash-4.1$ ./psql -p 5435 postgres
Password:
psql.bin (9.2.7)
Type "help" for help.
postgres=#
If the above workaround does not work, please share what error you are getting.
Hope this helps….
Thanks & Regards,
Abdul Sayeed
PostgreSQL DBA
Postgres Professional Certified
EnterpriseDB Corp
Skype: abdul.sayeed24