logoalt Hacker News

sfifsyesterday at 11:45 PM6 repliesview on HN

A bit off topic but the one thing I've never been able to figure out with Postgres easily & reliably is what magic incantations allow a user account full access to a specific database but not to others, particularly in cases of managed postgres offered by cloud providers. `GRANT ALL PRIVILEGES` never seems to work.

Having to look up and spend time fixing permissions every time itself makes using Postgres for simple uses difficult for me but if you're using it ad hoc, any tips?


Replies

direwolf20today at 2:30 AM

Isn't it something like GRANT ALL ON DATABASE foo TO USER bar

show 1 reply
wredcolltoday at 12:51 AM

I ran into this once... I think there's something about the grant not working on new objects or being one level too low? I tended to solve those problems by granting ownership of the db itself.

jamesfinlaysontoday at 1:00 AM

99% of the time I've used Postgres it has been one user and one database. The one time I needed to create and configure a separate user with different permissions I remember it being thoroughly confusing and I think the DBA ended up doing it.

mulmentoday at 12:55 AM

One of the best features of Postgres is the documentation. I recommend starting there.

MarcelOlsztoday at 12:20 AM

Just let Claude fuck it up for you and learn from its mistakes.