Change Ownership Recursively - Mailing list pgsql-sql

From Carlos Mennens
Subject Change Ownership Recursively
Date
Msg-id CAAQLLO7gqap3zYUGGd0fuTZjS8OWt86OUtvNQubLEGf40AyNfA@mail.gmail.com
Whole thread Raw
List pgsql-sql
I have a database that I must assign ownership to a new role. I want
this new role to own the entire database and all of it's tables,
views, triggers, & all. When I run the ALTER DATABASE command below,
it only changes the database role but the tables are all still owned
by the previous role. Is there a way I can assign the 27 tables to
Lauren rather than doing the command one by one for each table?

postgres=# ALTER DATABASE iamunix OWNER TO lauren;
ALTER DATABASE
postgres=# \l                                 List of databases  Name    |  Owner   | Encoding |   Collate   |    Ctype
  |
 
Access privileges
-----------+----------+----------+-------------+-------------+----------------------- iamunix   | lauren   | UTF8     |
en_US.UTF-8| en_US.UTF-8 |
 

All tables still owned by Carlos:

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

**PS**
I did do a Google search for "PostgreSQL 9.1 change ownership
recursively" but either couldn't find what I was looking for or
missed it.


pgsql-sql by date:

Previous
From: "Oliveiros d'Azevedo Cristina"
Date:
Subject: Re: Aggregate and join problem
Next
From: Carlos Mennens
Date:
Subject: Re: Change Ownership Recursively