I am new to PostgreSQL world and I am facing this issue:
When I try to start postgres 14 cluster using the following command:
pg_ctlcluster 14 testcluster start
It starts but gives me the hint that:
Warning: the cluster will not be running as a systemd service. Consider using systemctl:
sudo systemctl start postgresql@14-testcluster
And when I try the suggested command, it asks for unix user postgres password, which I have ever seen or set.
[sudo] password for postgres:
Note 1: Ubuntu 22.04
Note 2: I am running as postgres unix user using this command:
sudo su - postgres
What can I do?
1 Answer 1
You can either edit /etc/sudoers
to allow user postgres
to run that command without having to specify a password, or you start and stop PostgreSQL using a different operating system user that has the permission to run the command.
sudo su - postgres
(apparently as some other user), you can also dosudo systemctl start
(as that same user).