Re: changing ownership of db

From: Colin 't Hart <cthart(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: changing ownership of db
Date: 2003-07-30 09:17:06
Message-ID: pan.2003.07.30.09.17.06.78262@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stephan Szabo 2003-07-30 09:45:17 Re: [SQL] time precision.
Previous Message Anagha Joshi 2003-07-30 07:52:03 time precision.