1

I'm attempting to run this query

GRANT USAGE ON [db].users_uid_seq TO [user];

db and user are redacted (obviously).

I get this error:

ERROR: syntax error at or near "GRANT"

I've tried a number of permutations of users, including / not including the db prefix, slightly different syntax, etc. per other stack exchange postings with no luck.

I'm using PG 8.4 with namecheap's shared hosting plan. It looks like this wouldn't be an issue with a newer version of pg but I don't have that option right now.

Any suggestions are much appreciated.

Evan Carroll
65.7k50 gold badges259 silver badges510 bronze badges
asked Oct 23, 2017 at 17:28

1 Answer 1

1

The syntax for GRANT in PostgreSQL 8.4 is

GRANT { { USAGE | SELECT | UPDATE }
 [,...] | ALL [ PRIVILEGES ] }
 ON SEQUENCE sequencename [, ...]
 TO { [ GROUP ] rolename | PUBLIC } [, ...] [ WITH GRANT OPTION ]

You can't just exclude SEQUENCE. If you could it'd be in [], without which it's not optional.

GRANT USAGE ON SEQUENCE users_uid_seq TO myUser;

As a side note, PostgreSQL 8.4 was EOL on July 2014

answered Oct 23, 2017 at 17:37
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.