title: Trouble connecting to PostgreSQL in python with psycopg2
body: <p>I am having problems connecting to my database through postgreSQL3 version 9.5. However, after running the code below:</p>
  
  <pre><code>import psycopg2 as p
  
  con = p.connect("dbname ='dvdrental' user = 'myusername' host ='localhost' password ='somepassword'")
  cur = con.cursor()
  cur.execute("select * from title")
  rows = cur.fetchall()
  </code></pre>
  
  <p>I get this error message: </p>
  
  <pre><code>psycopg2.OperationalError: could not connect to server: Connection refused 
  (0x0000274D/10061)
  Is the server running on host "localhost" (::1) and accepting
  TCP/IP connections on port 5432?
  could not connect to server: Connection refused (0x0000274D/10061)
  Is the server running on host "localhost" (127.0.0.1) and accepting
  TCP/IP connections on port 5432?
  </code></pre>
  
  <p>For background information, I accidentally downloaded the newest version of PostgreSQL, and it connected to the part 5432. I need it to connect to PostgreSQL port 5433. I do not know how to do that. How can I solve this DB problem? Is this a PostgreSQL problem or a python problem?</p>