Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7875549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:00:02+00:00 2026-06-03T03:00:02+00:00

Using PostgreSQL 9.0, I have a group role called staff and would like to

  • 0

Using PostgreSQL 9.0, I have a group role called “staff” and would like to grant all (or certain) privileges to this role on tables in a particular schema. None of the following work

GRANT ALL ON SCHEMA foo TO staff;
GRANT ALL ON DATABASE mydb TO staff;

Members of “staff” are still unable to SELECT or UPDATE on the individual tables in the schema “foo” or (in the case of the second command) to any table in the database unless I grant all on that specific table.

What can I do make my and my users’ lives easier?

Update: Figured it out with the help of a similar question on serverfault.com.

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA foo TO staff;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:00:03+00:00Added an answer on June 3, 2026 at 3:00 am

    You found the shorthand to set privileges for all existing tables in the given schema. The manual clarifies:

    (but note that ALL TABLES is considered to include views and foreign tables).

    Bold emphasis mine. serial columns are implemented with nextval() on a sequence as column default and, quoting the manual:

    For sequences, this privilege allows the use of the currval and nextval functions.

    So if there are serial columns, you’ll also want to grant USAGE (or ALL PRIVILEGES) on sequences

    GRANT USAGE ON ALL SEQUENCES IN SCHEMA foo TO mygrp;
    

    Note: IDENTITY columns in Postgres 10 or later use implicit sequences that don’t require additional privileges. (Consider upgrading serial columns.)

    What about new objects?

    You’ll also be interested in DEFAULT PRIVILEGES for users or schemas:

    ALTER DEFAULT PRIVILEGES IN SCHEMA foo GRANT ALL PRIVILEGES ON TABLES TO staff;
    ALTER DEFAULT PRIVILEGES IN SCHEMA foo GRANT USAGE          ON SEQUENCES TO staff;
    ALTER DEFAULT PRIVILEGES IN SCHEMA foo REVOKE ...;
    

    This sets privileges for objects created in the future automatically – but not for pre-existing objects.

    Default privileges are only applied to objects created by the targeted user (FOR ROLE my_creating_role). If that clause is omitted, it defaults to the current user executing ALTER DEFAULT PRIVILEGES. To be explicit:

    ALTER DEFAULT PRIVILEGES FOR ROLE my_creating_role IN SCHEMA foo GRANT ...;
    ALTER DEFAULT PRIVILEGES FOR ROLE my_creating_role IN SCHEMA foo REVOKE ...;
    

    Note also that all versions of pgAdmin III have a subtle bug and display default privileges in the SQL pane, even if they do not apply to the current role. Be sure to adjust the FOR ROLE clause manually when copying the SQL script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using postgresql. I have a table called custom_field_answers. The data looks like
I'm using PostgreSQL 9.1 and I have this data structure: A B ------- 1
I am using PostgreSQL database. I have the data like below. id name1 name2
I'm using PostgreSQL with PostGis and have shapes of all countries loaded. How can
I am using PostgreSQL. I have the data in table like: Parent_id Count Read
Using PostgreSQL triggers, is it possible to record the changes that have happened to
I'm getting this error on Heroku but not locally (using PostgreSQL on both).. error
I have a function (stored procedure) defined in a database that I would like
I have a problem with creating a pivot table in PostgreSQL using the crosstab()
I have a Django web app that I would like to use in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.