Tablespace Issue

Started by Adarsh Sharmaabout 15 years ago2 messagesgeneral
Jump to latest
#1Adarsh Sharma
adarsh.sharma@orkash.com

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.

Also, Can I delete the old tablespace now .

Thanks & Best Regards,

Adarsh Sharma

#2Scott Mead
scottm@openscg.com
In reply to: Adarsh Sharma (#1)
Re: Tablespace Issue

On Thu, Feb 17, 2011 at 4:08 AM, Adarsh Sharma <adarsh.sharma@orkash.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

Show quoted text

Also, Can I delete the old tablespace now .

Thanks & Best Regards,

Adarsh Sharma

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general