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

  • SEARCH
  • Home
  • 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 8264325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:24:57+00:00 2026-06-08T04:24:57+00:00

How do I go about granting DML (SELECT,INSERT,UPDATE,DELETE) on all tables in a schema

  • 0

How do I go about granting DML (SELECT,INSERT,UPDATE,DELETE) on all tables in a schema in PostgreSQL 8.4? I’d also like this grant to persist for new table creation in the future as well.

I’ve seen solutions for 9.0 but I’m stuck with 8.4 as it ships with Debian stable.

I have tried the following as a baseline but it doesn’t work, resulting in the inevitable “access to relation X denied”:

GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser;

I’ve dredged through the documentation and I can’t seem to find a suitable solution.

  • 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-08T04:24:59+00:00Added an answer on June 8, 2026 at 4:24 am

    I’d also like this grant to persist for new table creation in the future as well.
    […] I’ve dredged through the documentation and I can’t seem to find a suitable solution.

    Because before 9.0 there is none. All you can get is to set the permissions for existing tables. You have to do one GRANT for each table, because before 9.0 there was no “bulk” mode. See the SQL grammer for 8.4 and 9.0:

    GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
        [,...] | ALL [ PRIVILEGES ] }
        ON [ TABLE ] tablename [, ...]
        TO { [ GROUP ] rolename | PUBLIC } [, ...] [ WITH GRANT OPTION ]
    

    and 9.0 here:

    GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
        [,...] | ALL [ PRIVILEGES ] }
        ON { [ TABLE ] table_name [, ...]
             | ALL TABLES IN SCHEMA schema_name [, ...] }
        TO { [ GROUP ] role_name | PUBLIC } [, ...] [ WITH GRANT OPTION ]
    

    The new ALL TABLES IN SCHEMA part is the one you are missing.

    Also: Setting permissions on the database level as in you question won’t help you: You will “only” set the permissions on he database, but not on any “contained” stuff like tables. The relevant section:

    GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
        ON DATABASE dbname [, ...]
        TO { [ GROUP ] rolename | PUBLIC } [, ...] [ WITH GRANT OPTION ]
    

    Which means you can only set CREATE, CONNECT and TEMP permissions on the database itself but no SELECT, INSERT etc.


    So far for the bad stuff. What you can do are the following things:

    • Reduce the number of permission management by granting rights not to users but to roles. Then add roles to individual users. When a new table is created you only need to adjust one or two roles, but not hundreds of users.

    • Query the system catalogues and create appropriate GRANT commands. Save them into a file and execute that file. This should give you an easier startup.

    Such a query might look like this:

    select 'GRANT ALL ON ' || table_schema || '.' || table_name ||' to my_group;' 
    from information_schema.tables 
    where 
        table_type = 'BASE TABLE' and 
        table_schema not in ('pg_catalog', 'information_schema');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

About five years ago I started using Generic lookup Tables for applications I was
About to create a form using Zend Form, all the form elements should have
About six years ago, a software engineer named Harri Porten wrote this article ,
According to this MSDN article about medium trust , under medium-trust: FileIOPermission is restricted.
I would like to have your opinion about the subject version control, but focusing
About every 3rd time my app serves a particular update action (two that I've
About web.py How do I redirrect the output to another output destination like a
i am creating a postgreSQL database reader which also includes a method for a
The user I have should have access to all tables in a database -
I'm probably missing something obvious or going about this in the wrong way, but

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.