From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Wainaina <petwah17@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: RESTRICT TABLE OWNER NOT TO DELETE IT
Date: Mon, 08 Mar 2021 10:58:12 -0500
Message-ID: <1741403.1615219092@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEEbwbfqg-xForZePcXDeuvP0mUWMRO6ys0ot_2rnhor6Ogppg@mail.gmail.com>
References: <CAEEbwbfqg-xForZePcXDeuvP0mUWMRO6ys0ot_2rnhor6Ogppg@mail.gmail.com>
Peter Wainaina <petwah17@gmail.com> writes:
> i need help on how to restrict the table owner no to drop/truncate the table
As far as Postgres is concerned, "can drop the object" is pretty much
the definition of ownership. Maybe you need to rethink who owns which
tables in your design. (Yes, you could use event triggers to interfere
with the normal system behavior, but that doesn't make it a good idea.)
The owner can revoke her own TRUNCATE privilege, but that's just a
mistake preventer, since she can also re-grant the privilege to herself.
regards, tom lane
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: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, petwah17@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: RESTRICT TABLE OWNER NOT TO DELETE IT
In-Reply-To: <1741403.1615219092@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox