Larsenmtl Larsenmtl
2007-Feb-26 22:03 UTC
Postgresql Sequences: permission denied on sequence?
Folks, I''m having trouble inserting a record into a progres table with a serial int as my id. The following--> irb> a_docRecord = Document.new(params["Document"]) => #<Document:0x2aaaad1745a8 @new_record=true, @attributes={"dtype"=>"4", "title"=>"", "uid"=>nil, "description"=>"", "notebooknumber"=>"", "pgroup"=>"1"}> irb> a_docRecord.save Returns--> ActiveRecord::StatementInvalid: PGError: ERROR: permission denied for sequence documents_id_seq : INSERT INTO documents ("dtype", "title", "uid", "description", "notebooknumber", "pgroup") VALUES(4, '''', NULL, '''', '''', 1) The user is not a Superuser but has full permssions to the table. My table is defined as--> CREATE TABLE documents ( id bigserial NOT NULL, title varchar, dtype int8, pgroup int8, description text, notebooknumber varchar, uid int8, CONSTRAINT id PRIMARY KEY (id) ) WITHOUT OIDS; ALTER TABLE documents OWNER TO postgres; GRANT ALL ON TABLE documents TO postgres; GRANT ALL ON TABLE documents TO GROUP "webUsers"; What am I missing? Thanks, LarsenMTL -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeremy Kemper
2007-Feb-26 22:07 UTC
Re: Postgresql Sequences: permission denied on sequence?
On 2/26/07, Larsenmtl Larsenmtl <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''m having trouble inserting a record into a progres table with a serial > int as my id. > > The following--> > irb> a_docRecord = Document.new(params["Document"]) > => #<Document:0x2aaaad1745a8 @new_record=true, > @attributes={"dtype"=>"4", "title"=>"", "uid"=>nil, "description"=>"", > "notebooknumber"=>"", "pgroup"=>"1"}> > irb> a_docRecord.save > > Returns--> > ActiveRecord::StatementInvalid: PGError: ERROR: permission denied for > sequence documents_id_seq > : INSERT INTO documents ("dtype", "title", "uid", "description", > "notebooknumber", "pgroup") VALUES(4, '''', NULL, '''', '''', 1) > > The user is not a Superuser but has full permssions to the table. > > My table is defined as--> > CREATE TABLE documents > ( > id bigserial NOT NULL, > title varchar, > dtype int8, > pgroup int8, > description text, > notebooknumber varchar, > uid int8, > CONSTRAINT id PRIMARY KEY (id) > ) > WITHOUT OIDS; > ALTER TABLE documents OWNER TO postgres; > GRANT ALL ON TABLE documents TO postgres; > GRANT ALL ON TABLE documents TO GROUP "webUsers"; > > What am I missing?Probably a grant on the documents_id_seq implicitly created by the bigserial column type. jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Larsenmtl Larsenmtl
2007-Feb-26 22:13 UTC
Re: Postgresql Sequences: permission denied on sequence?
Jeremy Kemper wrote:> Probably a grant on the documents_id_seq implicitly created by the > bigserial > column type.Dang, that was fast. Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---