Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

This has been making me crazy all day. I'm working on a small Node app that takes JSON objects and inserts or updates them into a Postgres table. Currently, my app is able to do insertions to the table without issue. However, the update task does not work and fails with the following error:

error updating player { [error: permission denied for relation players] name: 'error', length: 91, severity: 'ERROR', code: '42501', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'aclchk.c', line: '3371', routine: 'aclcheck_error' }

This is my current postgres userbase:

Role name | Attributes | Member of -----------+------------------------------------------------+----------- postgres | | {} myuser | Superuser, Create role, Create DB, Replication | {}

Yesterday I was having the same headache with the INSERT action, getting the same "permission denied" error which suddenly disappeared after a couple hours and I have no idea what I did/didn't do. I had been trying various GRANT commands to give myuser insertion privileges, which was confusing in the first place because I assumed that being a Superuser would give you everything by default.

I've tried many various GRANT commands to give myuser the UPDATE privilege to no avail. Postgres is very new and foreign to me as I normally work with Oracle or MySQL so if I've overlooked something simple or obvious please forgive me.

Any thoughts?

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.