pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Zot O'Connor <zot@zotconsulting.com>
To: pgsql-general@postgresql.org, postgres sql <pgsql-sql@hub.org>
Subject: change owner of database -- answer
Date: Mon, 06 Mar 2000 20:47:21 -0800
Message-ID: <38C489D9.8B286BD7@zotconsulting.com> (raw)

This was posted several times as a question, here is the answer that I used:

use createdb from whereever...

\d pg_database

Table    = pg_database
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| datname                          | name                             |    32 |
| datdba                           | int4                             |     4 |
| encoding                         | int4                             |     4 |
| datpath                          | text                             |   var |
+----------------------------------+----------------------------------+-------+

=> select * from pg_database;
datname    |datdba|encoding|datpath    
-----------+------+--------+-----------
template1  |   124|       0|template1  
mydatabase |   124|       0|mydatabase 


I then sent 
UPDATE pg_database SET datdba=99 WHERE datname=mydatabase;

And it updated the owner of the DB.

This area needs documentation!


-- 
Zot O'Connor

http://www.ZotConsulting.com
http://www.WhiteKnightHackers.com



Message-ID: <38C489D9.8B286BD7@zotconsulting.com>
Permalink:  ../38C489D9.8B286BD7@zotconsulting.com/
Also on:    postgresql.org/message-id/38C489D9.8B286BD7@zotconsulting.com

 · 

reply

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-sql@postgresql.org
  Cc: zot@zotconsulting.com, pgsql-sql@hub.org
  Subject: Re: change owner of database -- answer
  In-Reply-To: <38C489D9.8B286BD7@zotconsulting.com>
  References: <38C489D9.8B286BD7@zotconsulting.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