[lug] postgres question

dan radom dan at radom.org
Wed Nov 12 23:40:57 MST 2003


* Hugh Brown (hugh at math.byu.edu) wrote:
> On Wed, 2003-11-12 at 21:40, dan radom wrote:
> > * Hugh Brown (hugh at math.byu.edu) wrote:
> > > I am doing something that I could swear I've done a number of times.
> > > 
> > > As user postgres I create a user and a database.  Then as postgres I run
> > > GRANT ALL ON DATABASE newdb TO newuser;
> > > 
> > > In the past, that has been sufficient to give newuser privileges on
> > > everything.
> > > 
> > > This time when I do it, I find that it hasn't granted me privileges to
> > > anything.
> > > 
> > > newuser connects, tries a select and it fails with a permission denied.
> > > 
> > > It seems terribly stupid to have GRANT ALL ON DATABASE do absolutely
> > > noting except print "GRANT"
> > > 
> > 
> > pdel -s newdb
> > 
> > newdb=#\dp
> > 
> > will show you the permissions.  grant all on db to user; should get it.
> > 
> > dan
> 
> I tried that.  No perms show up.  I think all that grant all on database
> allows you to do is create new tables, new views, new triggers etc.
> 
> So, apparently in the past I have populated as the new user, not as
> postgres and then a grant all.  Disappointing command.
> 
> Hugh

Nah.  I do that all the time.  Here's a snippit from a sql file ...

GRANT ALL on lostfound_id_seq,screenshots_id_seq,pictures_id_seq,downloads_id_seq,users_id_seq to graffix;

It works just fine and does in fact grant the appropriate premissions.
Does the user in fact exist?  \du from psql will show you the users.
Perhaps you need to CREATE USER foo; first?  What version of postgres ..
SELECT version(); just in case :)

dan



More information about the LUG mailing list