Re: RESTRICT TABLE OWNER NOT TO DELETE IT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Wainaina <petwah17(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: RESTRICT TABLE OWNER NOT TO DELETE IT
Date: 2021-03-08 15:58:12
Message-ID: 1741403.1615219092@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Peter Wainaina <petwah17(at)gmail(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mai Peng 2021-03-09 17:51:15 ON CONFLICT on serial id
Previous Message RAJAMOHAN 2021-03-08 14:29:04 Re: could not load library "$libdir/plpython2" while upgrading from postgresql-10 to 12