Re: Tablespace Issue

From: Scott Mead <scottm(at)openscg(dot)com>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tablespace Issue
Date: 2011-02-17 13:32:27
Message-ID: AANLkTimioQM0zNL7UpNC8tLT0X6zgyHFuLMibK8BgkrK@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 17, 2011 at 4:08 AM, Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>wrote:

> Dear all,
>
> Today I got to have a strong issue while craeting table in a database.
>
> pdc_uima=# create table clause2_naxal as select * from clause2 c
> ,page_naxal_v3 p where c.source_id = p.crawled_page_id;
> ERROR: could not extend relation pg_tblspc/17208/17216/23098672: No space
> left on device
> HINT: Check free disk space.
> pdc_uima=# drop table clause2_naxal;
> ERROR: table "clause2_naxal" does not exist
>
> I thougt that that the hard disk becomes full in which the tablespace is
> created for pdc_uima database.
>
> So, I attach a new hard disk(300 Gb ) and create a new tablespace in it .
>
> And after, issue the below command :
>
> ALTER DATABASE pdc_uima SET TABLESPACE ts_pdc_uima1;
>
> It takes so much time as database size is near about 40 GB.
>
> It seems it moves the whole database to new place. I think this is not good
> for future. Is there is any way to have new data in new tablespace and
> remain old as it is.
>

There is a 'TABLESPACE' option to the CREATE TABLE statament.
http://www.postgresql.org/docs/current/static/sql-createtable.html

--Scott

>
> Also, Can I delete the old tablespace now .
>
>
> Thanks & Best Regards,
>
> Adarsh Sharma
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rsmogura 2011-02-17 13:37:54 Implement timestamp pseudotype
Previous Message John DeSoi 2011-02-17 13:04:20 Re: disable triggers using psql