Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've tried a few times to get postgresql running on a couple of different linux boxes, but I've always ended up binning it and going back to MySQL because I can't get my head around how to create and manage users.

This time around, I've actually gotten as far as being able to log in with my own account, but I created the account with the createuser command and it has a different password to my actual user account.

What I'd like to be able to do is log in as me to create databases, users and assign database permissions, but then have an account that is separate and doesn't have an account on the server to use with my web app.

Does anyone have a good step-by-step guide for complete morons that goes through creating users and assigning access to various databases in postgresql?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Explaining the full access control and permission system of a database is far beyond the scope of a Q&A site.

The best advice I can offer you is to look at the Postgres wiki shared database hosting page - many of these concepts generalize well to creating multiple roles in a single DB, or hosting multiple DBs on a single server.

In addition any of these books would make a good start/general reference, though you should try to find one on a recent version of Postgres (many are from the 7.x days). There is also a MOST EXCELLENT MANUAL provided by the Postgres project that you really must read.

If none of that is sufficient to enlighten you, and your own experimentation (on a development server please!) doesn't make it clear you should seek out an experienced DBA to mentor you, or spend some time at EnterpriseDB's Postgres training classes -- They are not cheap, but they are widely regarded as being excellent courses.

share|improve this answer
    
Thank you, the wiki link is a good starting point - it's all very similar to MySQL, but ever so slightly different, and with the extra pg_hba.conf wrangling which was confusing me because it didn't appear to be doing anything! It's difficult to actually get started but this should help. Thanks. –  MalphasWats Jun 21 '12 at 8:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.