ubuntu connect to postgres

C++
sudo su - postgrespsql
Source

Also in C++: