Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2A71C64FCCE for ; Tue, 9 Dec 2008 01:57:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 15772-02 for ; Tue, 9 Dec 2008 01:57:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ns1.aaaonlinux.net (NS1.AAAONLINUX.net [70.84.189.18]) by mail.postgresql.org (Postfix) with ESMTP id 41E8864FC02 for ; Tue, 9 Dec 2008 01:57:14 -0400 (AST) Received: (qmail 476 invoked by uid 508); 9 Dec 2008 06:03:43 -0000 Received: from unknown (HELO direction.biz) (59.163.21.147) by ns1.aaaonlinux.net with SMTP; 9 Dec 2008 06:03:43 -0000 Received: from [172.16.2.20] ([172.16.2.20]) (authenticated user s.borse@direction.biz) by direction.biz (direction.biz) (MDaemon PRO v9.0.0) with ESMTP id md50000209009.msg for ; Tue, 09 Dec 2008 11:24:37 +0530 Subject: Re: dba and tables spaces questions From: Suresh Borse Reply-To: s.borse@direction.biz To: isabella.ghiurea@nrc-cnrc.gc.ca Cc: pgsql-admin@postgresql.org In-Reply-To: <493D9DB3.3080202@nrc-cnrc.gc.ca> References: <493D9DB3.3080202@nrc-cnrc.gc.ca> Content-Type: multipart/alternative; boundary="=-nUlfQUGV5TAcZyDF6YRE" Organization: DSS Date: Tue, 09 Dec 2008 11:18:17 +0530 Message-Id: <1228801697.2262.8.camel@dss-052.dsslp.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-9.fc7) X-Authenticated-Sender: s.borse@direction.biz X-Spam-Processed: direction.biz, Tue, 09 Dec 2008 11:24:37 +0530 (not processed: spam filter heuristic analysis disabled) X-MDRemoteIP: 172.16.2.20 X-Return-Path: s.borse@direction.biz X-MDaemon-Deliver-To: pgsql-admin@postgresql.org X-MDAV-Processed: direction.biz, Tue, 09 Dec 2008 11:24:38 +0530 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200812/68 X-Sequence-Number: 30901 --=-nUlfQUGV5TAcZyDF6YRE Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, you may try following. You can create a one more table-space by using following command, -- Tablespace: "tablespace - name " -- DROP TABLESPACE tablespace_name CREATE TABLESPACE tablespace_name OWNER "UserName" LOCATION 'path '; -- path for table-space And move the existing object to other tablespace using following command psql>ALTER TABLE table_name SET TABLESPACE tablespace_name; Next, while adding new object take care of defining the tablespace name also. On Mon, 2008-12-08 at 14:20 -0800, Isabella Ghiurea wrote: > Dear pg Gurus, > I would like to know : > 1- how can I alter an existing db on new table space, is there a cmd > :alter db add tablespace2 etc ? > 2- how can in create db allocate 2 -n tables spaces for a db ? " create > db name with tablespace 1= .. and tablespace2=.... "will this be a > valid cmd ? Or other solution to this issues ? > using Pg version 8.3 on Linux > Thank you in advance > Isabella > > > Thanks & Regards, Suresh Borse (DBA) _________________________________________________________________________________________ DIRECTION SOFTWARE SOLUTIONS 5, Brady Gladys Plaza, 1/447, Senapati Bapat Marg, Lower Parel, Mumbai - 400 013 Tel. : 91 22 66615000 (Ext: 350) Fax : 91 22 24911046 Cell : 91 9422 239338 Site : www.direction.biz _________________________________________________________________________________________ --=-nUlfQUGV5TAcZyDF6YRE Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi,

you may try following.

You can create a one more table-space by using following command,

-- Tablespace: "tablespace - name "

-- DROP TABLESPACE tablespace_name

CREATE TABLESPACE tablespace_name
  OWNER "UserName"
  LOCATION 'path ';             --  path for table-space

And move the existing object to other tablespace using following command

psql>ALTER TABLE table_name SET TABLESPACE tablespace_name;

Next, while adding new object take care of defining the tablespace name also.




On Mon, 2008-12-08 at 14:20 -0800, Isabella Ghiurea wrote:
Dear pg Gurus,
I would like to know :
1- how can I alter an existing db on new table space, is there a cmd 
:alter db add tablespace2 etc ?
2- how can in create db allocate 2 -n tables spaces for a db ? "  create 
db  name with tablespace 1= .. and tablespace2=....   "will this be a 
valid cmd ? Or other solution to this issues ?
using Pg version 8.3 on Linux
Thank you in advance
Isabella



Thanks & Regards,

Suresh Borse
(DBA)
_________________________________________________________________________________________
DIRECTION SOFTWARE SOLUTIONS
5, Brady Gladys Plaza, 1/447, Senapati Bapat Marg, Lower Parel, Mumbai - 400 013
Tel.   : 91 22 66615000     (Ext: 350)             Fax    : 91 22 24911046             
Cell   : 91 9422 239338                               Site    : www.direction.biz
_________________________________________________________________________________________
--=-nUlfQUGV5TAcZyDF6YRE--