Quantcast
Channel: Creating a postgres user - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Creating a postgres user

$
0
0

I want to make a typical user in postgres that will be used by my web application.

  1. The web application will require access to all tables.
  2. The user should be able to read/write to all tables (select, update, delete, insert)

All tables belong to the public schema

What is the best practise for creating this user?

database name: acmeincuser: acmeuser

I tried this so far and I was not able to even update a table (permission error on the relation):

create user acmeusergrant all privileges on database acmeinc to acmeuseralter schema public owner to acmeuserALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO acmeuser

Update:

I was running the above like:

psql acmeinc -c "create user acmeuser"

Should I be creating a role and then associating the user acmeuser to the role?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images