X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B69DA9FA506 for ; Mon, 17 Jul 2006 10:26:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 89346-05 for ; Mon, 17 Jul 2006 10:25:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from projects.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id D348B9FA418 for ; Mon, 17 Jul 2006 10:25:51 -0300 (ADT) Received: from [192.168.199.109] (dsl.static81214124250.ttnet.net.tr [81.214.124.250] (may be forged)) (authenticated bits=0) by projects.commandprompt.com (8.13.6/8.13.6) with ESMTP id k6HDPmIo009584; Mon, 17 Jul 2006 06:25:49 -0700 Subject: Re: Changing a database owner on postgres 7.3 From: Devrim GUNDUZ To: Richard George Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain Organization: Command Prompt, Inc. Date: Mon, 17 Jul 2006 16:26:00 +0300 Message-Id: <1153142760.2418.30.camel@laptop.gunduz.org> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5.sam.2) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.2, clamav-milter version 0.88.2 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (projects.commandprompt.com [192.168.2.159]); Mon, 17 Jul 2006 06:25:51 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/138 X-Sequence-Number: 22384 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. Regards, -- The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/