Found an article on the network http://www.linuxidc.com/Linux/2010-04/25232.htm, as follows:
Ubuntu 9.10 under PostgreSQL 8. 4 solutions to forgotten passwords Ubuntu9.10 Next PostgreSQL 8. 4 Solutions to forgotten passwords:1. Edit the pg_hba.conf in the83# IPV4 Local connections:$ host All 127.0.0.1/32Trust[email protected]:/etc/postgresql/8.4/main$ sudo vim pg_hba.conf[email protected]:/etc/postgresql/8.4/main$ sudo/etc/init.d/postgresql-8.4restart* restarting PostgreSQL8.4Database Server2. [Email protected]:~$ psql-h127.0.0.1-u postgrespsql (8.4.2) SSL connection (Cipher:dhe-rsa-aes256-sha, bits:256) Type ' help ' for Help.postgres=# ALTER USER postgres with PASSWORD ' Mickey ';ALTER rolepostgres=# \q3The back of the pg_hba.conf in the83# IPV4 Local connections:$ host All 127.0.0.1/32Md5[email protected]:/etc/postgresql/8.4/main$ sudo vim pg_hba.conf[email protected]:/etc/postgresql/8.4/main$ sudo/etc/init.d/postgresql-8.4restart* restarting PostgreSQL8.4 Database Server[OK]
Tested, also available under Windows version 9.1.