473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Grant question

What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.

--
Barbara E. Lindsey,
COG RDC
Phone: (352) 392-5198 ext. 314 Fax: (352) 392-8162

----
CONFIDENTIALITY NOTICE: The information contained in this electronic
message is legally privileged and confidential and intended only for the
use of the individual(s) or entity(ies) named above. If the reader of
this message is not the intended recipient, you are hereby notified that
any dissemination, distribution, or copying of this email or any of it's
components is strictly prohibited. If you have received this email in
error, please contact the sender.
----
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #1
7 4288
Mensaje citado por Barbara Lindsey <bl******@cog.ufl.edu>:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.


You have to give him grant permissons on the sequence, not only the table, as when
you do a nextval(´sequece_name´) you are updating the value of the sequence.

P.D.: Could there be some extra docs about this in the GRANT command manual:

http://www.postgresql.org/docs/curre...sql-grant.html

It speeks about granting all kind of relations, but not sequences. Just a tip.

--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-------------------------------------------------------
Martín Marqués | Programador, DBA
Centro de Telemática | Administrador
Universidad Nacional
del Litoral
-------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #2
On Thu, Jan 29, 2004 at 09:52:56 -0500,
Barbara Lindsey <bl******@cog.ufl.edu> wrote:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.


Sequences have permissions separate from tables. I believe you need
update access to call nextval or setval on a sequence. This should
be described in the documention on the GRANT command.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #3
Yay! It works.
Thank you.

Bruno Wolff III wrote:
On Thu, Jan 29, 2004 at 09:52:56 -0500,
Barbara Lindsey <bl******@cog.ufl.edu> wrote:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.

Sequences have permissions separate from tables. I believe you need
update access to call nextval or setval on a sequence. This should
be described in the documention on the GRANT command.


--
Barbara E. Lindsey,
COG RDC
Phone: (352) 392-5198 ext. 314 Fax: (352) 392-8162

----
CONFIDENTIALITY NOTICE: The information contained in this electronic
message is legally privileged and confidential and intended only for the
use of the individual(s) or entity(ies) named above. If the reader of
this message is not the intended recipient, you are hereby notified that
any dissemination, distribution, or copying of this email or any of it's
components is strictly prohibited. If you have received this email in
error, please contact the sender.
----
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #4
I think you should provide an explicit grant (all) on the sequence as
well. The Sequence is an object that is distinct from the table that uses
it.

John Sidney-Woollett

Barbara Lindsey said:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.

--
Barbara E. Lindsey,
COG RDC
Phone: (352) 392-5198 ext. 314 Fax: (352) 392-8162

----
CONFIDENTIALITY NOTICE: The information contained in this electronic
message is legally privileged and confidential and intended only for the
use of the individual(s) or entity(ies) named above. If the reader of
this message is not the intended recipient, you are hereby notified that
any dissemination, distribution, or copying of this email or any of it's
components is strictly prohibited. If you have received this email in
error, please contact the sender.
----
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #5
What permission does a user need to have to query the pg_ tables
(pg_attribute, pg_class, etc) ? Do they require special permissions?
arbara Lindsey wrote:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.


--
Barbara E. Lindsey,
COG RDC
Phone: (352) 392-5198 ext. 314 Fax: (352) 392-8162

----
CONFIDENTIALITY NOTICE: The information contained in this electronic
message is legally privileged and confidential and intended only for the
use of the individual(s) or entity(ies) named above. If the reader of
this message is not the intended recipient, you are hereby notified that
any dissemination, distribution, or copying of this email or any of it's
components is strictly prohibited. If you have received this email in
error, please contact the sender.
----
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #6
El Jue 29 Ene 2004 16:26, Barbara Lindsey escribió:
What permission does a user need to have to query the pg_ tables
(pg_attribute, pg_class, etc) ? Do they require special permissions?


What kind of queries? Read or Write?

Users have permission to read from most catalog tables. One they can't read
for security resons is pg_shadow:

prueba=> select * from pg_shadow;
ERROR: pg_shadow: permission denied

Saludos... :-)

--
16:44:01 up 64 days, 23:00, 3 users, load average: 0.46, 0.38, 0.30
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 22 '05 #7
On Thu, Jan 29, 2004 at 09:52:56 -0500,
Barbara Lindsey <bl******@cog.ufl.edu> wrote:
What kind of grant do you need to give a user so that they can have
permission to do a "SELECT nextval(ID)" on a sequence?
I granted the user SELECT,UPDATE,INSERT,DELETE on all the tables,
including the one that has the sequence, but the sequence query is
failing on permissions.


Sequences have permissions separate from tables. I believe you need
update access to call nextval or setval on a sequence. This should be
described in the documention on the GRANT command.

CREATE SEQUENCE paid.person_person_pk_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 232
CACHE 1;
REVOKE ALL ON TABLE paid.person_person_pk_seq FROM public;
GRANT ALL ON TABLE paid.person_person_pk_seq TO blindsey;
GRANT SELECT, UPDATE ON TABLE paid.person_person_pk_seq TO GROUP app_user;

~Berend Tober


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Martin v. Löwis | last post by:
The Python Software Foundation is seeking grant proposals for projects related to the further development of Python, Python-related technology, and educational resources. The PSF plans to issue...
4
by: Amardeep Verma | last post by:
Hi, I have a quick question. Which role/privileges are required before a user can give the statement "GRANT ALL PRIVILEGES"? Thanking you in Advance Have a nice day
0
by: Charles Cantrell | last post by:
I have recently set up mySQL on a Mandrake release of Linux (Version 7 of Mandrake, I believe), using the binary 4.0.13 standard release. The set up and start up all were normal, as far as I...
0
by: Charles Cantrell | last post by:
I have recently set up mySQL on a Mandrake release of Linux (Version 7 of Mandrake, I believe), using the binary 4.0.13 standard release. The set up and start up all were normal, as far as I...
1
by: Adam Smith | last post by:
I have a new DB provided by my ISP don't know details of installation, setup etc. I can log in as anybody except root. mysql -h localhost -u mysql Welcome to the MySQL monitor. Commands end...
27
by: Igor V. Rafienko | last post by:
Hi, I am trying to understand how cElementTree's clear works: I have a (relatively) large XML file, that I do not wish to load into memory. So, naturally, I tried something like this: from...
3
by: Chris Ochs | last post by:
Is there a shortcut to grant all privileges on a schema and it's objects to a user without having to issue GRANT statements for each individual object in the schema? Given all the possible types...
1
by: everymn | last post by:
Hi, Supposedly the Alter Routine privilege can be granted at the level of a single routine but I haven't been able to get that to work. I've tried it a number of different ways like: GRANT...
7
by: MNNovice | last post by:
Please forgive me for this is a long request. I am designing a DB to capture expenses related to Federal Grants and to generate appropriate reports. Each grant starts with a Notice of Grant Award...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.