Re: Postgresql setup on Debian system

2013-12-11 Thread Chris Bannister
On Tue, Dec 10, 2013 at 06:25:16PM -0800, Gary Roach wrote:
 automatically (I think). I found the Debian README confusing,
 especially in regards to setting up a special shell that I don't
 think I need. 

Are you referring to the postgres user?

-- 
If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing. --- Malcolm X


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20131211121125.GB12607@tal



Re: Postgresql setup on Debian system

2013-12-11 Thread Gary Roach

On 12/10/2013 11:13 PM, Raffaele Morelli wrote:
2013/12/11 Gary Roach gary719_li...@verizon.net 
mailto:gary719_li...@verizon.net


I just switched from using PHP and Mysql to Python / Django and
Postgresql. I am having trouble with the setup of Postgresql
permissions. I am locked out of some parts of the system and am
unsure when to use postgres login vs user login. Most of the
Postgresql instructions are written for non-debian like
installations. They have one do a bunch of things that Debian does
automatically (I think). I found the Debian README confusing,
especially in regards to setting up a special shell that I don't
think I need. Most of the instructions seem to have already been
done automatically.


Debian does not tweak things for you, the special shell you are 
talking about is just (I guess) the psql terminal interface to postgres.


Postgres permissions administration is not trivial and if you are 
looking for security on a per database basis you should read carefully 
how it works.

http://www.postgresql.org/docs/9.1/static/client-authentication.html

BTW you are not clear: what are you trying to achieve?
Not too surprising that I wasn't clear. I feel like I'm floundering 
around. I am trying to build a data archiving system that will have 
multiple levels of users and has a web page access system. Python, 
Django, html and javascript will take care of most of the project. I 
just need to get the permissions setup for Postgresql. Thanks for 
pointing out Chapter 19 of the manual. I haven't read it yet but will do 
so asap. I guess I am primarily struggling with the setting up of 
accounts and roles; which I guess is about 90% of the database setup. I 
probably need to just read more and hope for the best.


Gary R.


Re: Postgresql setup on Debian system

2013-12-11 Thread Raffaele Morelli
2013/12/11 Gary Roach gary719_li...@verizon.net

  On 12/10/2013 11:13 PM, Raffaele Morelli wrote:

  BTW you are not clear: what are you trying to achieve?

 Not too surprising that I wasn't clear. I feel like I'm floundering
 around. I am trying to build a data archiving system that will have
 multiple levels of users and has a web page access system. Python, Django,
 html and javascript will take care of most of the project. I just need to
 get the permissions setup for Postgresql. Thanks for pointing out Chapter
 19 of the manual. I haven’t read it yet but will do so asap. I guess I am
 primarily struggling with the setting up of accounts and roles; which I
 guess is about 90% of the database setup. I probably need to just read more
 and hope for the best.

 Gary R.


you are using a frontend that should keep care of user permissions, then
you should create one role (user) on postgres with all permission on a
database he must own.

so, as user postgres create a role for the frontend (eg. groach), then log
into postgres as groach and create a database (eg. mydatabase).
pgadmin or phppgadmin are your friends if you're not familiar with terminal
interfaces in doing this.

next add the relevant line to your pg_hba.conf (first line is for clarity).
this will grant connection to database `mydatabase` to user `groach` from
all ip addresses, using md5 encryption method.

# TYPE  DATABASEUSERADDRESS METHOD
hostmydatabasegroachall
md5


Re: Postgresql setup on Debian system

2013-12-10 Thread Raffaele Morelli
2013/12/11 Gary Roach gary719_li...@verizon.net

 I just switched from using PHP and Mysql to Python / Django and
 Postgresql. I am having trouble with the setup of Postgresql permissions. I
 am locked out of some parts of the system and am unsure when to use
 postgres login vs user login. Most of the Postgresql instructions are
 written for non-debian like installations. They have one do a bunch of
 things that Debian does automatically (I think). I found the Debian README
 confusing, especially in regards to setting up a special shell that I don't
 think I need. Most of the instructions seem to have already been done
 automatically.


Debian does not tweak things for you, the special shell you are talking
about is just (I guess) the psql terminal interface to postgres.

Postgres permissions administration is not trivial and if you are looking
for security on a per database basis you should read carefully how it works.
http://www.postgresql.org/docs/9.1/static/client-authentication.html

BTW you are not clear: what are you trying to achieve?