473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

I want to drop a tablespace, but it says tablespace is not empty. What am I missing?

Hello everyone,

I moved all tables and indices out of a tablespace to a different tablespace (different hard drive and different mountpoint). Now I want to drop the old tablespace but it says the tablespace is not empty.

If I go into the tablespace directory i see bunch of files. I was told that these cannot be deleted, but if I'm trying to drop this tablespace anyway, can I just delete these files? Will this affect the tables that are moved to the new tablespace

Expand|Select|Wrap|Line Numbers
  1. <code>PG_9.5_201510051/259388 # du -sh *
  2. 1.1G    2935335227
  3. 1.1G    2935335227.1
  4. 1.1G    2935335227.2
  5. 138M    2935335227.3
  6. 1.1G    2935335230
  7. 1.1G    2935335230.1
  8. 1.1G    2935335230.2
  9. 1.1G    2935335230.3
  10. 1.1G    2935335230.4
  11. 1.1G    2935335230.5
  12. 266M    2935335230.6
  13. 139M    2935335232</code>
Any guidance would be appreciated
Thanks in advance
May 21 '19 #1
3 14663
zmbd
5,501 Expert Mod 4TB
!! Very important, make absolutely sure you have a backup of your database. It's very difficult to recover !!

Have you tried the following:
https://www.postgresql.org/docs/8.4/...ag-dropdb.html
Login to the database as the owner or superuser
Expand|Select|Wrap|Line Numbers
  1. DROP DATABASE dbYourDbNameHere;
  2. DROP TABLESPACE yourTableSpaceNameHere;
May 22 '19 #2
Gevoergun
1 Bit
The tablespace files take up too little space for you to delete them for no good reason.
Mar 6 '22 #3
Zentro
1 Bit
You can delete tablespace files. However, you cannot be completely sure that you are not deleting something important. I, too, thought these files were not that important and ended up deleting important system files that were worth keeping on disk. Of course, that was stupid. Don't repeat my mistakes if you don't want to go to salvagedata.com later. I turned to them because I knew that there was no other way to get back the important table space configurations that I had foolishly erased from my computer's memory irretrievably. Thankfully, there are now services like this, where they can save and restore everything.
Mar 7 '22 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sandeep G | last post by:
I've a table which has a number & a blob column, both of which are NOT NULL type. This table is composite partitioned using range & hash on the same column. Each partition is sub partitioned into...
2
by: robert | last post by:
the real DBAs aren't around for a few days, so rather than shoot myself in a tender spot, i thought i'd ask first. what docs i can find say that the syntax is: DROP TABLESPACE FOO seems...
1
by: news.sbcglobal.net | last post by:
Can anyone tell me how to fix this so that my drop down list is not empty when the page loads (ASP.NET 2.0). Thanks!: ------------------------------ HTML ----------------------------- <%@...
1
by: jainarayan5484 | last post by:
hi All, Sir i want to know That What is the need to Create Tablespace,Alter TableSpace,Drop Tablespace.Whereas database use default tablespace. plz help me ...
0
by: wugon.net | last post by:
Env: DB2 LUW V8 + FP14 AIX 5.3 Problem Description: Our production database create one big temporary tablespace to do off- line reorg, after reorg complete, we drop this tablespace online...
1
by: bujjus173 | last post by:
Hi, I need to drop a tablespace, I am unable to drop because it says the containers it uses is inaccessible, because a process deleted the container. the tablespace went into pending state. I just...
1
by: deshaipet | last post by:
Hi friends - I created a automatic storage tablespace with a pagesize of 16 K and initial size of 64 MB. create large tablespace test_tbsp1 pagesize 16k managed by automatic storage autoresize...
1
by: Kelly K | last post by:
I am trying to send out letters. PhysicianName PrimaryHospital Address1 Address2 Address3 CityStateZipCode Some of the fields are blank (example: address3 tends to be blank unless there is...
4
by: Stevestan1 | last post by:
I have a query that is connected to a form. There are 2 dropdown boxes in the form that are connected to two columns on the query. I would like the query to search for all records if those 2...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.