Org.postgresql.util.psqlexception Error Permission Denied For Sequence
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about postgres grant usage on all sequences Stack Overflow the company Business Learn more about hiring developers or posting ads with
Postgres Sequence Permissions
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is error: permission denied for relation a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR: permission denied for sequence cities_id_seq using Postgres up vote 60 down vote
Grant Select On Sequence
favorite 14 I'm new at postgres (and at database info systems all in all). I ran following sql script on my database: create table cities ( id serial primary key, name text not null ); create table reports ( id serial primary key, cityid integer not null references cities(id), reportdate date not null, reporttext text not null ); create user www with password 'www'; grant select on cities to www; error: permission denied for schema grant insert on cities to www; grant delete on cities to www; grant select on reports to www; grant insert on reports to www; grant delete on reports to www; grant select on cities_id_seq to www; grant insert on cities_id_seq to www; grant delete on cities_id_seq to www; grant select on reports_id_seq to www; grant insert on reports_id_seq to www; grant delete on reports_id_seq to www; When, as the user www, trying to: insert into cities (name) values ('London'); I get the following error: ERROR: permission denied for sequence cities_id_seq I get that the problem lies with the serial type. That's why I grant select, insert and delete rights for the *_id_seq to www. Yet this does not fix my problem. What am I missing? sql postgresql permissions auto-increment share|improve this question edited Nov 4 '14 at 20:25 dsolimano 6,11832746 asked Feb 17 '12 at 8:24 Vampnik 4272818 Granting insert/delete on a sequence does not make sense to me. I'm surprised that it even works. –a_horse_with_no_name Feb 17 '12 at 13:02 add a comment| 4 Answers 4 active oldest votes up vote 94 down vote accepted Since PostgreSQL 8.2 you have to use: GRANT USAGE, SELECT ON SEQUENCE cities_id_seq TO www; GRANT USAGE - For sequenc
Sign in Pricing Blog Support Search GitHub This repository Watch 258 Star 7,383 Fork 299 begriffs/postgrest Code Issues 71 Pull requests 1 Projects 0 Wiki Pulse Graphs New issue Error "permission denied for sequence
Postgres Show Grants
user_id_seq" when POSTing #251 Closed omani opened this Issue Aug 4, 2015 · 5
Postgres List Schemas
comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants omani commented Aug postgres create user 4, 2015 Hi, I guess this is more a postgresql question than releated to postgrest, but anyway: I created a table in schema public named user. Then I created a view in schema "1" named http://stackoverflow.com/questions/9325017/error-permission-denied-for-sequence-cities-id-seq-using-postgres users AS a simple select * from public.user. I can GET and DELETE entries from the above view. but when I want to insert a new row I get the error as mentioned in the title: the grants look as followed: GRANT ALL ON TABLE public.user TO superuser; GRANT ALL ON TABLE "1".users TO superuser; GRANT ALL ON TABLE "1".users TO myuser; GRANT myuser TO superuser; Notice: user "myuser" is https://github.com/begriffs/postgrest/issues/251 the user who gets a token from postgrest (that is, he is not the anonymous user). Do I have to explicitly set a GRANT on the user_id_seq sequence as well? Because nothing is mentioned in the docs of postgrest and I wondered if it is my fault that this does not work. Owner begriffs commented Aug 4, 2015 Oh I think you do have to grant access to the sequence too. Give it a try and let me know if that helps. grant all on sequence user_id_seq to myuser; omani commented Aug 4, 2015 yes after a GRANT on the user_id_seq it works for me. Owner begriffs commented Aug 4, 2015 Excellent! Could you update the docs please? omani commented Aug 4, 2015 Of course. thank you. omani commented Aug 4, 2015 wiki updated. https://github.com/begriffs/postgrest/wiki/Security-and-Permissions/_history omani closed this Aug 4, 2015 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
pgsql-announce pgsql-bugs pgsql-docs pgsql-general pgsql-interfaces pgsql-jobs pgsql-novice pgsql-performance pgsql-php pgsql-sql pgsql-students Developer lists Regional https://www.postgresql.org/message-id/94039537-66DA-4EF3-816B-C48BE089AE68@seespotcode.net lists Associations User groups Project lists Inactive lists IRC Local User Groups Featured Users International Sites Propaganda Resources Weekly News Re: Permission denied for sequence From: Michael Glaesemann