title: psql "role is not permitted to login" & "could not connect to server"
body: <p>I cloned a project i did on cloud9 IDE on my computer. This project is on rails and use Heroku &amp; postgresql.</p>
  
  <p>I want to launch it from my computer, i did everything needed to launch the project like install libs, bundle install, install postgresql etc...</p>
  
  <p>But it seems i missed something for postgresql. I encounter 2 issues</p>
  
  <p>The first one, I can't launch psql directly from my bash like i do on Cloud9. I must do :</p>
  
  <pre><code>sudo -i -u postgres //it open something like a new bash
  psql //then psql is launch
  </code></pre>
  
  <p>I wish to be able to type only psql but it display</p>
  
  <pre><code>role tellimi is not permitted to log in
  </code></pre>
  
  <p>I tried to create role (<a href="https://stackoverflow.com/questions/35254786/postgresql-role-is-not-permitted-to-log-in">PostgreSQL: role is not permitted to log in</a>) but the message became</p>
  
  <pre><code>database tellimi does not exist
  </code></pre>
  
  <p>but tellimi is my username, not a database</p>
  
  <p>Then i wanted to check my database on salesforce so i add the url in a new env variable $DTABASE_URL but when i do </p>
  
  <pre><code>psql $DATABASE_URL
  </code></pre>
  
  <p>it display</p>
  
  <blockquote>
    <p>psql: could not connect to server: Connexion terminée par expiration du délai d'attente
        Is the server running on host "ec2-54-247-125-202.eu-west-1.compute.amazonaws.com" (54.247.125.202) and accepting
        TCP/IP connections on port 5432?</p>
  </blockquote>
  
  <p>So how to set-up correctly postgresql to answer those 2 problems?</p>