Re: Change Ownership Recursively - Mailing list pgsql-sql

From Carlos Mennens
Subject Re: Change Ownership Recursively
Date
Msg-id CAAQLLO7W6pAKz26k=JV8W_47O+DT6kOf--U3QKkmgXq_s7LfMw@mail.gmail.com
Whole thread Raw
In response to Change Ownership Recursively  (Carlos Mennens <carlos.mennens@gmail.com>)
Responses Re: Change Ownership Recursively  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-sql
On Thu, Mar 1, 2012 at 11:38 AM, Eric Ndengang
<eric.ndengang_foyet@affinitas.de> wrote:
> Hi
> You can try this command "REASSIGN OWNED BY .... TO ..." like this:
> REASSIGN OWNED BY previous_role TO new_role;
>  DROP OWNED previous_role;

I did as follows:

iamunix=# \c postgres
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
You are now connected to database "postgres" as user "carlos".
postgres=# REASSIGN OWNED BY carlos TO lauren;
REASSIGN OWNED
postgres=# DROP OWNED BY carlos;
DROP OWNED

iamunix=# \d              List of relationsSchema |       Name       |   Type   | Owner
--------+------------------+----------+--------public | dept             | table    | carlospublic | dept_id_seq      |
sequence| carlospublic | employees        | table    | carlospublic | employees_id_seq | sequence | carlospublic |
manager_lookup  | view     | carlospublic | managers         | table    | carlospublic | managers_id_seq  | sequence |
carlos

That didn't work for some reason but mostly because I don't follow the
concept of what's being done. I've now since changed the database role
owner back to Carlos so now 'Carlos' owns both the database and all of
it's tables. Can we start fresh and assume I just got the request to
change the specified database and all of it's tables, sequences,
views, & triggers to Lauren?


pgsql-sql by date:

Previous
From: Carlos Mennens
Date:
Subject: Change Ownership Recursively
Next
From: "F. BROUARD / SQLpro"
Date:
Subject: Re: Natural sort order