![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
After an insert statement, I need a the members of a user group to get the recently inserted statement's primary key that was created from a sequence, with the currval() function. For example: select currval('subject_subject_id_seq') The table is "subject", the primary key name is "subject_id" and the sequence is "subject_subject_id_seq". The user group in question already has permission to execute SELECT, INSERT, and UPDATE queries on the table "subject". I have read the documentation and searched on-line but I have yet to figure out the correct syntax that the "postgres" account must execute. The following is what I have so far: GRANT USAGE ON SEQUENCE subject_subject_id_seq TO GROUP my_user_group; but I get a syntax error. |
#3
| |||
| |||
|
|
Please show us the *CORRECT* error-message and your pg-version, i have 8.4.2, the latest stable. |
|
Please show us the *CORRECT* error-message and your pg-version, i have 8.4.2, the latest stable. |
#4
| |||
| |||
|
|
I am using 8.1.15. I execute: test=# CREATE GROUP test_group_01; CREATE ROLE test=# ALTER GROUP test_group_01 ADD USER ivan; ALTER ROLE test=# CREATE TABLE bla (bla_id serial); NOTICE: CREATE TABLE will create implicit sequence "bla_bla_id_seq" for serial column "bla.bla_id" CREATE TABLE test=# GRANT USAGE ON SEQUENCE bla_bla_id_seq TO GROUP test_group_01; ERROR: syntax error at or near "bla_bla_id_seq" at character 25 LINE 1: GRANT USAGE ON SEQUENCE bla_bla_id_seq TO GROUP test_group_0... |
#5
| |||
| |||
|
|
Try using GRANT SELECT ON SEQUENCE bla_bla_id_seq TO GROUP test_group_01; |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
After an insert statement, I need a the members of a user group to get the recently inserted statement's primary key that was created from a sequence, with the currval() function. For example: select currval('subject_subject_id_seq') |
![]() |
| Thread Tools | |
| Display Modes | |
| |