On Tue, 29 Jul 2003 17:41:08 -0400, Tom Lane wrote:
> Devrim GUNDUZ <devrim(at)gunduz(dot)org> writes:
>> On Tue, 29 Jul 2003, Benjamin Thelen (CCGIS) wrote:
>>> I would like to change the ownership of a database.
>
>> UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE
>> usename='new_owner') WHERE datname='db_name';
>
> That is all you need to do --- it's the only place CREATE DATABASE
> records the owner's identity.
Would it be an idea to encapsulate this as
ALTER DATABASE db_name SET OWNER = 'new_owner'
or something similar?
What syntax would be desired and would you accept a patch?
Cheers,
Colin