From: Colin 't Hart <cthart@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: Re: changing ownership of db
Date: Wed, 30 Jul 2003 11:17:06 +0200
Message-ID: <pan.2003.07.30.09.17.06.78262@yahoo.com> (raw)
References: <Pine.LNX.4.44.0307291956570.17013-100000@emo.org.tr>
<4647.1059514868@sss.pgh.pa.us>
On Tue, 29 Jul 2003 17:41:08 -0400, Tom Lane wrote:
> Devrim GUNDUZ <devrim@gunduz.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: cthart@yahoo.com
Subject: Re: changing ownership of db
In-Reply-To: <pan.2003.07.30.09.17.06.78262@yahoo.com>
References: <Pine.LNX.4.44.0307291956570.17013-100000@emo.org.tr> <4647.1059514868@sss.pgh.pa.us> <pan.2003.07.30.09.17.06.78262@yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox