Re: Changing DB ownership

From: Christopher Murtagh <christopher(dot)murtagh(at)mcgill(dot)ca>
To: japsey(at)futuredental(dot)com
Cc: postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Changing DB ownership
Date: 2003-08-05 16:58:33
Message-ID: 1060102712.1445.15.camel@mafalda.murtagh.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2003-08-05 at 11:11, Jimmie H. Apsey wrote:
> Why would you want to do that?

Why would I want to change ownership of a database? I could think of
numerous reasons.

> Why not do it an easier way and dump the database and restore it into
> your new database?

Because that would mean that the database would be down while I did
that. The users to whom I gave ownership to the DB already had
permissions on the tables in the DB. This meant no down time.

> There's got to be a lot of stuff to consider when doing something as
> radical as renaming a database.

I didn't rename any database, nor do anything 'radical'. Please re-read
my message and you'll see.

This SQL query:

UPDATE pg_database SET datdba = 504 WHERE datname='chris';

is obviously simpler than a pg_dump, dropdb, createdb, pg_restore.

Cheers,

Chris

--

Christopher Murtagh
Webmaster / Sysadmin
Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-08-05 17:00:49 Re: plPHP -- sort of an announcement.. but not commercial
Previous Message Peter Eisentraut 2003-08-05 16:48:29 Re: plPHP -- sort of an announcement.. but not commercial