Skip site navigation (1) Skip section navigation (2)

Re: Django + Postgressql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Dean <robbington(at)hotmail(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Django + Postgressql
Date: 2010-08-31 14:26:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Robert Dean <robbington(at)hotmail(dot)co(dot)uk> writes:
> postgres(at)myvps:/root$ psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'mypassword';"
> could not change directory to "/root"

Dunno anything about django, but what this looks like is you logged in
as root and then did "su postgres" rather than "su - postgres".  So now
you're still in root's $HOME, but you can't read the current directory
for lack of permissions.  A lot of stuff will act a bit squirrelly in
that context, not only psql.  Use "su - postgres".  Better yet, create
another superuser named after your regular user account, so that you can
do Postgres stuff without going through root in the first place.

> createdb: database creation failed: ERROR:  source database "template1" is being accessed by other users
> DETAIL:  There are 1 other session(s) using the database.

"select * from pg_stat_activity" might tell you something about that.

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Josh KupershmidtDate: 2010-08-31 14:48:14
Subject: Re: Reduce Calculations in SELECT
Previous:From: Tom LaneDate: 2010-08-31 14:21:58
Subject: Re: Function Returning Table/Record

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group