By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Dropping a tablespace - windows

P: 4
I have a tablespace that is not being used and I want to drop it. When I try to drop the tablespace either via pgAdmin III or an sql command I get the following error:

cannot read directory "pg_tblspc/20612": No such file or directory

I have tired to manually create those directories in the location listed as the target folder for the tablespace. Error still occurs. The tablespace may have encountered errors during creation.

Ideas how I get rid of this tablesapce?

Aug 21 '09 #1
Share this Question
Share on Google+
5 Replies

Expert 100+
P: 700
What does the query show
Expand|Select|Wrap|Line Numbers
  1. select * from pg_tablespace;
Aug 21 '09 #2

P: 4
spcname | spcowner | spclocation | spcacl
pg_default | 10 | |
pg_global | 10 | |
cmatblspace | 10 | /dbdata/cmadbfiles |
(3 rows)
Aug 21 '09 #3

Expert 100+
P: 700
Can you connect via psql client and run query
Expand|Select|Wrap|Line Numbers
  1. drop tablespace tablespace_you_want_to_delete;
I guess you want to drop cmatblspace, don't you?

You can also try to run this query via pgadmin3.
Aug 21 '09 #4

P: 4
correct, i wish to drop the cmatblspace tablespace.

drop tablespace cmatblspace;

ERROR: could not read directory "pg_tblspc/20612": No such file or directory
Aug 21 '09 #5

P: 4
Some additional info:

I found information in the 8.1 documentation (I am using 8.4) that pg_tblspc is a directory under the data dir for postgres for holding soft links to files. Sure enough there is a pg_tblspc/20612 folder under the data folder for postgres. When I click on the 20612 folder, I get the following:

C:\Program Files (x86)\PostgresSQL\8.4\data\pg_tblspc\20612refers to a location that is unavailable. It could be a hard drive on this computer, or on the network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a differenct location.
Aug 21 '09 #6

Post your reply

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