On 07/16/2015 04:53 PM, Chris Angelico wrote:
On Fri, Jul 17, 2015 at 9:34 AM, Gary Roach <gary719_li...@verizon.net> wrote:
On 07/15/2015 11:25 AM, Chris Angelico wrote:

You should then be able to create a regular user, and grant
appropriate permissions:

postgres=# create user archives password
'traded-links-linguistics-informal';
CREATE ROLE
postgres=# grant all on database archivedb to archives;
GRANT
I really appreciate the help Chris. I created a user archive with password
'xxxxxx' and changed the settings.py file accordingly. When I tried  python
manage.py migrate I got the following error with it's traceback:

(archivedb)root@supercrunch:~/archivedb# python manage.py migrate
[chomp]
django.db.utils.ProgrammingError: permission denied for relation
django_migrations
This suggests that your new user doesn't have permissions set yet. Did
you do the grant command as listed above? If so, you may have to also
do this:

$ sudo sudo -u postgres psql archivedb
postgres=# grant all on all tables in schema X to archives;
I did the above.
Replace X with the name of the database schema you use - possibly
"public" or some other user name. You can list multiple schema names,
separated by commas, if you need to.

To list all schemas in the database:

select distinct table_schema from information_schema.tables;
I did all of the above. Since I only plan on one datebase - excluding the system db's - I'm dumping everything into the public schema.
Hope that helps!

ChrisA
I'm still getting the same migration error.

At this point, I'm confused about a few things. Does the postgresql server and my archivedb reside globally or are they inside my archivedb virtual environment. I think globally.

To get pgAdmin3 to work, I have to have it set so that it logs in as gary ( no choice with this) and set group to root. Then in application > advanced options set run as different user to root. This assumes that you are using a KDE4 desktop and have these option by right clicking the icons.

pgAdmin3 data:
    Server Group > Server(1) > archivedb
|_ Host name - 127.0.0.1
                                                    |_ username - archive
                                                    |_ connected - no
Archivedb requires a password to go deeper and takes the xxxxxx password that is in the django settings.py file. This opens up access to archivedb and lists archivedb > Schema(1) > public > tables(10). At this point I found that all of the sequences and all of the tables are owned by root. This is probably the root (no pun intended) cause. Now what do I do about it. I'm not sure how this came about so don't know how to fix it.

In the OS I have a postgres user in the passwd file and in the group file have the following:
    gary:x:1000:root,backuppc,sudo,postgres,users
    root:x:0:backuppc,gary,staff,postgres,users
    postgres:x:117:root,gary

Normally, I don't have to worry too much about security because my two user network resides behind a verizon router firewall. I don't have much in the way of sensitive data either. This project may be different. So maybe I need to tighten things up a bit.

Thanks for your help

Gary R



--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to