# cat /etc/passwd|grep postgres
postgres:x:105:109:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
// Change passwd Unix postgres user
$ su - postgres //login to postgres user
$ sudo passwd postgres //Change Unix password of postgres user
// Change passwd of DB User (inside postgres)
$ psql //login to db
psql (16.6 (Ubuntu 16.6-0ubuntu0.24.04.1))
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes
-----------+------------------------------------------------------------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS
postgres=# ALTER USER postgres WITH PASSWORD 'new_password'; //Change password
ALTER ROLE
postgres=#
|
// Port provided at time of installation
C:\Users\user> netstat -ant | find "5432"
TCP 0.0.0.0:5432 0.0.0.0:0 LISTENING InHost
TCP [::]:5432 [::]:0 LISTENING InHost
// During installtion postgres creates user=postgres
// password is provided during installation only
C:\Users\user> psql -U postgres
Password for user postgres:
psql (17.3)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=#
|