Re: [SQL] Change Ownership Recursively

2012-03-02 Thread Emi Lu
iamunix=# \c postgres was really meant to be: iamunix=# \c - postgres The first changes to database postgres as current user, the second changes the user while remaining on the current database. This is very helpful! psql> \c - username_for_new_connection -- Emi -- Sent via pgsql-sql m

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
On 03/01/2012 11:37 AM, Carlos Mennens wrote: I changed to the suggested database which is owned by 'Carlos' and did as instructed. Everything worked fine. Thank you! In your previous post my guess is this: iamunix=# \c postgres was really meant to be: iamunix=# \c - postgres The first chan

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Carlos Mennens
I changed to the suggested database which is owned by 'Carlos' and did as instructed. Everything worked fine. Thank you! On Thu, Mar 1, 2012 at 11:23 AM, Carlos Mennens wrote: > I did do a Google search for "PostgreSQL 9.1 change ownership > recursively" but either couldn't find what I was lookin

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Adrian Klaver
On 03/01/2012 09:04 AM, Carlos Mennens wrote: On Thu, Mar 1, 2012 at 11:38 AM, Eric Ndengang 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 con

Re: [SQL] Change Ownership Recursively

2012-03-01 Thread Carlos Mennens
On Thu, Mar 1, 2012 at 11:38 AM, Eric Ndengang 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: 2

[SQL] Change Ownership Recursively

2012-03-01 Thread Carlos Mennens
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 th