postgres DB requiring ownership to alter sequence

from the postgres server log, i keep seeing this error:

2015-07-07 20:04:59 EDT [22757]: [1-1] user=cvt_web,db=powerup_betz ERROR:  must be owner of relation seq_id_cti_data
2015-07-07 20:04:59 EDT [22757]: [2-1] user=cvt_web,db=powerup_betz STATEMENT:  ALTER SEQUENCE mla.SEQ_ID_CTI_DATA INCREMENT BY 50
2015-07-07 20:04:59 EDT [22757]: [3-1] user=cvt_web,db=powerup_betz ERROR:  must be owner of relation seq_id_cti_data_map
2015-07-07 20:04:59 EDT [22757]: [4-1] user=cvt_web,db=powerup_betz STATEMENT:  ALTER SEQUENCE mla.SEQ_ID_CTI_DATA_MAP INCREMENT BY 50

apparently you need to be owner in order to alter the sequence, granting all privileges to cvt_web user doesn't work, only being an owner works.  can someone tell me why this is the case.  thanks.
LVL 1
mmingfeilamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

earth man2Commented:
From the documentation.
You must own the sequence to use ALTER SEQUENCE. To change a sequence's schema, you must also have CREATE privilege on the new schema. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the sequence's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the sequence. However, a superuser can alter ownership of any sequence anyway.)

Rules is rules.

Why would you want anybody who is not the owner to be able to change a sequence ?  If you want 50 consecutive numbers then use serial function setval instead.
0
mmingfeilamAuthor Commented:
Can you show me the link to the documentation you read? Also, if I am using open jpa and my entity class requires a sequence to generate id for insertion, I am not sure I get the logics that I need to actually own the sequence on order to do that. Granting usage privileged should work, but in my case, granting all privilege still doesn't work. Thanks.
0
earth man2Commented:
http://www.postgresql.org/docs/9.3/static/functions-sequence.html

you can get postgreSQL to auto generate id's using default clause in table column definition and get them back using RETURNING clause of INSERT SQL statement.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mmingfeilamAuthor Commented:
i find that if i use trategy=GenerationType.IDENTITY as opposed to sequence, then everything works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.