Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #98409

Problems connecting to PostgreSQL

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.python
Subject Problems connecting to PostgreSQL
Date 2015-11-08 00:40 +0100
Organization Decebal Computing
Message-ID <87wptt5qg4.fsf@Equus.decebal.nl> (permalink)

Show all headers | View raw


I followed http://zetcode.com/db/postgresqlpythontutorial/.

I used:
    sudo -u postgres createuser stressTest
this create the role, but also gave:
    could not change directory to "/root": Permission denied
and I did not get the questions.

Then I used:
    sudo -u postgres createdb stressTest -O stressTest
This gave also:
    could not change directory to "/root": Permission denied

The database is created, but when I execute:
    conn = psycopg2.connect(database = postgres_database, user = 'stressTest')
I get:
    psycopg2.OperationalError: FATAL:  Peer authentication failed for user "stressTest"

What do I need to do to get things working?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Problems connecting to PostgreSQL Cecil Westerhof <Cecil@decebal.nl> - 2015-11-08 00:40 +0100
  Re: Problems connecting to PostgreSQL Chris Angelico <rosuav@gmail.com> - 2015-11-08 10:54 +1100
  Re: Problems connecting to PostgreSQL Chris Warrick <kwpolska@gmail.com> - 2015-11-08 09:36 +0100
    Re: Problems connecting to PostgreSQL Cecil Westerhof <Cecil@decebal.nl> - 2015-11-09 13:59 +0100

csiph-web