postgresql.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files

When i restart postgresql, i get following error postgres@vmi465483:~$ systemctl restart postgresql.service Failed to restart postgresql.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files See system logs and ‘systemctl status postgresql.service’ for details. postgres@vmi465483:~$ This is because you are running the command as user postres. Login as user “root”, you will be able … Read more

PostgreSQL List all databases

PostgreSQL

To list all databases in the PostgreSQL database, first connect to the PostgreSQL database using psql command Now run This will list all available databases. To change to a database, use the command /connect Once you are connected to a database, you can list all tables in a database with the command

PostgreSQL Create Database

To create a database, run CREATE DATABASE “DB_NAME_HERE”; Creating user, grant permissions CREATE USER USER_NAME_HERE WITH PASSWORD ‘BAPT788HZutBdV’; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO USER_NAME_HERE; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO USER_NAME_HERE; GRANT USAGE ON SCHEMA public TO USER_NAME_HERE; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA … Read more