X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C36E453AA1 for ; Fri, 22 Apr 2005 14:15:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98935-09 for ; Fri, 22 Apr 2005 17:15:12 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 9148E53A25 for ; Fri, 22 Apr 2005 14:15:12 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j3MHF6J2035364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Apr 2005 11:15:09 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j3MHF6lb091654; Fri, 22 Apr 2005 11:15:06 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j3MHF60C091653; Fri, 22 Apr 2005 11:15:06 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 22 Apr 2005 11:15:06 -0600 From: Michael Fuhr To: "Tomeh, Husam" Cc: pgsql-admin@postgresql.org Subject: Re: Another Data directory for second database - feasible? Message-ID: <20050422171506.GA91586@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/320 X-Sequence-Number: 17333 On Fri, Apr 22, 2005 at 09:10:35AM -0700, Tomeh, Husam wrote: > > I have a postgres installation with one database on a server. I'd need > to create another database; however, I'm curious if there's a way to > create the second database in a different directory than the existing > one. Is that feasible and how? Or does postgres only point to one data > directory? Thanks in advance. Each database is stored in its own directory, usually under $PGDATA/base. Do you mean you want to create a database somewhere else? What version of PostgreSQL are you using? 8.0 and later support tablespaces; in previous versions you could use the technique described in the "Alternative Locations" section of the "Managing Databases" chapter in the documentation. http://www.postgresql.org/docs/8.0/interactive/manage-ag-tablespaces.html http://www.postgresql.org/docs/8.0/interactive/sql-createdatabase.html http://www.postgresql.org/docs/7.4/interactive/manage-ag-alternate-locs.html http://www.postgresql.org/docs/7.4/interactive/sql-createdatabase.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/