pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Williamson <gwilliamson39@yahoo.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: 9.1 QUestion -- directory left over after drop database
Date: Mon, 6 Feb 2012 14:55:53 -0800 (PST)
Message-ID: <1328568953.37574.YahooMailNeo@web46113.mail.sp1.yahoo.com> (raw)

I have been playing a bit with a 9.1 instance as we plan for some new data.

I created a database in a tablespace:

  CREATE DATABASE foo2test2 TEMPLATE template1 TABLESPACE data1;

I set my default tablesapce and create a dummy table with a small amount of data:
  SET default_tablespace = data1;
  CREATE TABLE testx(d_id serial not null,d_text text,d_val integer);
  CREATE INDEX testx ON dingbats (d_id);
  INSERT INTO testx VALUES (22,'A test value');
  INSERT INTO testx VALUES(1011,'Another test value');

This created two new directories in my data1 tablespace:
-bash-3.2$ ls -lrt
total 40
drwx------ 2 postgres postgres 4096 Jan 16 10:13 1262754833
drwx------ 2 postgres postgres 4096 Jan 17 09:40 1262752970
drwx------ 2 postgres postgres 4096 Jan 26 19:08 1848319667
drwx------ 2 postgres postgres 4096 Jan 27 11:30 1262751111
drwx------ 2 postgres postgres 4096 Jan 27 15:12 979045183
drwx------ 2 postgres postgres 4096 Jan 31 16:37 3891138239
drwx------ 2 postgres postgres 4096 Jan 31 17:45 3891099801
drwx------ 2 postgres postgres 4096 Feb  6 10:14 941593524
drwx------ 2 postgres postgres 4096 Feb  6 14:38 1577008279   <-- the database itself
drwx------ 2 postgres postgres 4096 Feb  6 14:38 12698            <-- my little table

If I drop the database as a whole this 12698 directory is left in place but is empty.

If I drop just the table the directory is left with 0 length files:
-bash-3.2$ ls -lrt 12698
total 0
-rw------- 1 postgres postgres 0 Feb  6 14:49 1577013889
-rw------- 1 postgres postgres 0 Feb  6 14:49 1577011574
-rw------- 1 postgres postgres 0 Feb  6 14:49 1577011572
-rw------- 1 postgres postgres 0 Feb  6 14:49 1577011568

Are these safe to delete these files ?

Is it safe to delete the directory itself ?

Thanks,

Greg Williamson
DBA 
Powerreviews.com



Message-ID: <1328568953.37574.YahooMailNeo@web46113.mail.sp1.yahoo.com>
Permalink:  ../1328568953.37574.YahooMailNeo@web46113.mail.sp1.yahoo.com/
Also on:    postgresql.org/message-id/1328568953.37574.YahooMailNeo@web46113.mail.sp1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gwilliamson39@yahoo.com
  Subject: Re: 9.1 QUestion -- directory left over after drop database
  In-Reply-To: <1328568953.37574.YahooMailNeo@web46113.mail.sp1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox