public inbox for [email protected]  
help / color / mirror / Atom feed
From: Christoph Moench-Tegeder <[email protected]>
To: Atul Kumar <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: default privileges are npt working
Date: Fri, 30 Aug 2024 14:49:01 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+ONtZ6SGGWm-cRWG0ms5dmH2d1W+Nd7Pm1aB_2C8CbYExyoZg@mail.gmail.com>
References: <CA+ONtZ6SGGWm-cRWG0ms5dmH2d1W+Nd7Pm1aB_2C8CbYExyoZg@mail.gmail.com>

## Atul Kumar ([email protected]):

> Then I granted default "select" privileges to reader *user *to read data of
> all tables created by writer *user* using below command:
> 
> alter default privileges in schema <custom schema> grant select on tables
> to <reader user>.

"ALTER DEFAULT PRIVILEGES allows you to set the privileges that
will be applied to objects created in the future. (It does not affect
privileges assigned to already-existing objects.)"
That's the first two sentences from
https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html
If you want to grant/revoke access on existing objects, use plain
old GRANT/REVOKE: https://www.postgresql.org/docs/current/sql-grant.html

Regards,
Christoph

-- 
Spare Space.






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: default privileges are npt working
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox