-1

I have an INSERT statement. This statement works properly when using superuser.

I have a (non-super) user with SELECT, INSERT privileges on the targeted table. This user has CONNECT privileges to the database. This user is able to perform SELECT queries to this table and others.

However, this user can't perform INSERT statement to the targeted table.

I may not be all that good with Postgres but I really can't see the problem here.

I have tried GRANTing ALL PRIVILEGES to the said user, but still it didn't work.

Thoughts?

EDIT (per request):

GRANT statement: GRANT SELECT, INSERT ON TABLE users_log TO user

The GRANT statement seems to work fine when I do it.

Radek Postołowicz
  • 4,506
  • 2
  • 30
  • 47
  • You to show us the complete `GRANT` statements you used –  May 19 '15 at 17:20
  • So you are saying that the user `user` can't run an `insert into users_log ..` statement? Did you really name a user `user`? –  May 19 '15 at 17:31
  • 2
    please add to your question the insert and the error message you get. – 1010 May 19 '15 at 17:32
  • @a_horse_with_no_name No I did not name the user "user". But the name should be irrelevant. – user4830276 May 19 '15 at 17:35
  • Does the insert statement do a sub-select or something of that nature, or is it just inserting literal tuples? – Kevin May 19 '15 at 18:05
  • 2
    Without an error message, it's very hard to help you, we can only guess what goes wrong. Changing usernames in queries doesn't help either, you might have fixed the problem without knowing it. – Frank Heikens May 19 '15 at 18:09

1 Answers1

0

There simply was an issue with my sequences USAGE right, as I had a SERIAL auto-incrementing id column in my table and my user did not have the right privileges for that! Thanks everyone!