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

Re: Django + Postgressql

From: "SUNDAY A(dot) OLUTAYO" <olutayo(at)sadeeb(dot)com>
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:12:03
Message-ID: 1500301495.2331.1283263923355.JavaMail.root@mail (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
You do not need to be a root to login nor create sys account for postgres just switch user to postgres e.g 
sudo -u postgres psql template1 

The template1 could an exiting db you are login into, it a default template you use before create a user db. 

Sunday Olutayo 

I seem to be having problems configuring Postgres with Django and was wondering if someone could help me as I cant find any tutorials that fit my problem. 

First, I seem to be having issues with my postgres permissions/or understand them. 

Trying to connect to a database in root I get "psql: FATAL: role "root" does not exist" 

Also after trying this I get: 
postgres(at)myvps:/root$ psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'mypassword';" 
could not change directory to "/root" 
postgres(at)myvps:/root$ createdb mytestdb 
could not change directory to "/root" 
createdb: database creation failed: ERROR: source database "template1" is being accessed by other users 
DETAIL: There are 1 other session(s) using the database. 

Can someone help me figure this out? Why can it not change directory to root and why is template1 being accesed by another user? 

Thanks in advance 


In response to

pgsql-novice by date

Next:From: Carel CombrinkDate: 2010-08-31 14:16:46
Subject: Reduce Calculations in SELECT
Previous:From: Robert DeanDate: 2010-08-31 13:41:32
Subject: Django + Postgressql

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