Re: Changing a database owner on postgres 7.3

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: Changing a database owner on postgres 7.3
Дата
Msg-id 6064hwb8f9.fsf@dba2.int.libertyrms.com
обсуждение исходный текст
Ответ на Changing a database owner on postgres 7.3  ("Richard George" <rcgeorge23@hotmail.com>)
Список pgsql-admin
devrim@commandprompt.com (Devrim GUNDUZ) writes:
> Hi,
>
> On Mon, 2006-07-17 at 12:33 +0000, Richard George wrote:
>> I've run into trouble attempting to change the owner of a particular
>> database. The offending line is -
>>
>> ALTER DATABASE test OWNER TO epg;
>
> There is no way to change ownership of a database with ALTER DATABASE in
> 7.3.X .
>
>> Can someone suggest an alternative way of changing the owner of a
>> database for 7.3?
>
> AFAIR there is no quick-and-easy way to do that for 7.3. I'd create a
> new database with a new username, and I'd use the old database as the
> template:
>
> CREATE DATABASE newdb WITH OWNER newuser TEMPLATE olddb;
>
> could work for you.

I expect you could do the following:

   update pg_database set datdba = (select usesysid from pg_shadow
   where usename = 'epg') where datname = 'test';

Behind the scenes, that's probably what "ALTER DATABASE test OWNER TO
epg;" actually does.
--
output = reverse("gro.mca" "@" "enworbbc")
http://www.ntlug.org/~cbbrowne/emacs.html
"Catapultam  habeo!  Nisi  pecuniam omnem  mihi dabis,  ad  caput tuum
saxum immane mittam !!" (I have a  catapult!  If you do not pay me the
money you owe me, I will hit you with a big rock !!)
-- Simon Gornall <simon@unique-id.com>

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Rojas, Fernando (CIAT)"
Дата:
Сообщение: Restarting PostgreSQL
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Recycle error logs