Re: Changing owner objects - Mailing list pgadmin-support

From Guillaume Lelarge
Subject Re: Changing owner objects
Date
Msg-id 45F15B8C.4080003@lelarge.info
Whole thread Raw
In response to Changing owner objects  (Laurent ROCHE <laurent_roche@yahoo.com>)
List pgadmin-support
Laurent ROCHE a ecrit le 09/03/2007 12:58:
> Is there an easy way (in one go) to change the owner of all database objects with PG Admin ?
> 
> I am creating  a schema with a script that assign the objects owner to login (I mean conection role) A .
> Then I switch the schema owner to login (/conection role) B.
> 
> But the objects are still owned by A.
> Is there an easy way in PG Admin to change the owner obejcts from A to B ?
> 

If you use PostgreSQL 8.2, you can  REASSIGN OWNED BY A TO B;

Use of REASSIGN/DROP OWNED is on the roadmap 
(http://www.pgadmin.org/development/roadmap.php) but they aren't done yet.

> I have created a little script doing this but it's a shame I can not do this easily in PG Admin.
> (because my script is still a bit of a manual process as I don't know the PG database well enough to have a
completelyautomatic script).
 
> 
> May be, we changing the schema owner, PG Admin could prompt whether the schema objects owner should be changed as
well(for each objects).
 
> 

We aren't sure that all objects in this schema are owned by the same 
user. But perhaps we can add some code to "emulate" REASSIGN OWNED for 
older PostgreSQL releases.

Regards.


-- 
Guillaume.


pgadmin-support by date:

Previous
From: Laurent ROCHE
Date:
Subject: Changing owner objects
Next
From: Laurent ROCHE
Date:
Subject: Re : Changing owner objects