Re: SQL command : ALTER DATABASE OWNER TO

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: gparc(at)free(dot)fr, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: SQL command : ALTER DATABASE OWNER TO
Date: 2024-01-24 16:13:01
Message-ID: cbf04b89a1bb488ff7ed2f9914e064b4332ec002.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, 2024-01-24 at 08:47 -0700, David G. Johnston wrote:
> I dislike this change, ownership of an object is completely independent of
> the grant system of privileges.  The granted privileges of the old row do
> not transfer to the new owner when alter ... owner to is executed. 

CREATE TABLE mytab ();

REVOKE ALL ON mytab FROM PUBLIC;

\z mytab
Access privileges
Schema │ Name │ Type │ Access privileges │ Column privileges │ Policies
════════╪═══════╪═══════╪═══════════════════════════╪═══════════════════╪══════════
public │ mytab │ table │ postgres=arwdDxt/postgres │ │
(1 row)

ALTER TABLE mytab OWNER TO laurenz;

\z mytab
Access privileges
Schema │ Name │ Type │ Access privileges │ Column privileges │ Policies
════════╪═══════╪═══════╪═════════════════════════╪═══════════════════╪══════════
public │ mytab │ table │ laurenz=arwdDxt/laurenz │ │
(1 row)

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message gparc 2024-01-24 16:23:04 Re: SQL command : ALTER DATABASE OWNER TO
Previous Message David G. Johnston 2024-01-24 15:47:06 Re: SQL command : ALTER DATABASE OWNER TO