pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Safe to delete files?
6+ messages / 3 participants
[nested] [flat]

* Safe to delete files?
@ 2019-04-12 20:11  Paul van der Linden <paul.doskabouter@gmail.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Paul van der Linden @ 2019-04-12 20:11 UTC (permalink / raw)
  To: pgsql-general

Hi,

For my process, I needed to drop all the tables in a tablespace except one
which I truncated.
After that I would have expected to have a couple of KB max in that folder,
but there was about 200GB in it.

There were 2 sets of files (<id1>, <id1>.1 .. <id1>.99, and the same for
id2).
Tried the various options from
https://blog.2ndquadrant.com/postgresql-filename-to-table/ and oid2name
(with -i), to trace it back to a table but all came up empty.

Now this folder has a bit of a history spanning several postgres versions
and upgrades, and sometime in the past one of the upgrades went horribly
wrong, so my first thought was that this was possibly some leftovers from
that mishap, but the filetimes were a bit later than that.
Also hard to tell because those tables are used as write-once, read-alot so
could not base the last usage on filedate.

Normally I probably would dare to risk deleting those files, but after the
dropping and truncating, the 2 files without extension had the time of
drop/truncate and were 0 bytes in length (unfortunately I didn't check the
filesize before drop/truncating).

Are there other options to see if these files are leftovers from previous
stuff and not used by postgres (so i can safely delete them)?

Postgres 11, just one used database on it (the other one being a postgis
template), running on windows server 2012.

In replies please use reply to all...

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Safe to delete files?
@ 2019-04-13 00:06  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Paul van der Linden <paul.doskabouter@gmail.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2019-04-13 00:06 UTC (permalink / raw)
  To: Paul van der Linden <paul.doskabouter@gmail.com>; pgsql-general

On 4/12/19 1:11 PM, Paul van der Linden wrote:
> Hi,
> 
> For my process, I needed to drop all the tables in a tablespace except 
> one which I truncated.
> After that I would have expected to have a couple of KB max in that 
> folder, but there was about 200GB in it.
> 
> There were 2 sets of files (<id1>, <id1>.1 .. <id1>.99, and the same for 
> id2).

Can you show the actual dir listing?

> Tried the various options from 
> https://blog.2ndquadrant.com/postgresql-filename-to-table/ and oid2name 
> (with -i), to trace it back to a table but all came up empty.
> 
> Now this folder has a bit of a history spanning several postgres 
> versions and upgrades, and sometime in the past one of the upgrades went 
> horribly wrong, so my first thought was that this was possibly some 
> leftovers from that mishap, but the filetimes were a bit later than that.
> Also hard to tell because those tables are used as write-once, read-alot 
> so could not base the last usage on filedate.
> 
> Normally I probably would dare to risk deleting those files, but after 
> the dropping and truncating, the 2 files without extension had the time 
> of drop/truncate and were 0 bytes in length (unfortunately I didn't 
> check the filesize before drop/truncating).
> 
> Are there other options to see if these files are leftovers from 
> previous stuff and not used by postgres (so i can safely delete them)?
> 
> Postgres 11, just one used database on it (the other one being a postgis 
> template), running on windows server 2012.
> 
> In replies please use reply to all...


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Safe to delete files?
@ 2019-04-13 00:09  Ron <ronljohnsonjr@gmail.com>
  parent: Paul van der Linden <paul.doskabouter@gmail.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Ron @ 2019-04-13 00:09 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 4/12/19 3:11 PM, Paul van der Linden wrote:
> Hi,
>
> For my process, I needed to drop all the tables in a tablespace except one 
> which I truncated.
> After that I would have expected to have a couple of KB max in that 
> folder, but there was about 200GB in it.

Did you vacuum afterwards?

>
> There were 2 sets of files (<id1>, <id1>.1 .. <id1>.99, and the same for id2).
> Tried the various options from 
> https://blog.2ndquadrant.com/postgresql-filename-to-table/ and oid2name 
> (with -i), to trace it back to a table but all came up empty.
>
> Now this folder has a bit of a history spanning several postgres versions 
> and upgrades, and sometime in the past one of the upgrades went horribly 
> wrong, so my first thought was that this was possibly some leftovers from 
> that mishap, but the filetimes were a bit later than that.
> Also hard to tell because those tables are used as write-once, read-alot 
> so could not base the last usage on filedate.
>
> Normally I probably would dare to risk deleting those files, but after the 
> dropping and truncating, the 2 files without extension had the time of 
> drop/truncate and were 0 bytes in length (unfortunately I didn't check the 
> filesize before drop/truncating).
>
> Are there other options to see if these files are leftovers from previous 
> stuff and not used by postgres (so i can safely delete them)?
>
> Postgres 11, just one used database on it (the other one being a postgis 
> template), running on windows server 2012.
>
> In replies please use reply to all...

-- 
Angular momentum makes the world go 'round.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Safe to delete files?
@ 2019-04-13 14:10  Paul van der Linden <paul.doskabouter@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Paul van der Linden @ 2019-04-13 14:10 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general; ronljohnsonjr@gmail.com

It was just 99 files of 1GB each for each id, and no I didn't vacuum.
I did see disk usage dropping quite a lot after dropping those tables
though, so I expected postgres to delete all unneccesary files for all the
tables.

However when checking just now I saw that the files I was referring to were
indeed deleted somehow (don't have an autovacuum running).
So not sure how or why, but my problem is solved

On Sat, Apr 13, 2019 at 2:06 AM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 4/12/19 1:11 PM, Paul van der Linden wrote:
> > Hi,
> >
> > For my process, I needed to drop all the tables in a tablespace except
> > one which I truncated.
> > After that I would have expected to have a couple of KB max in that
> > folder, but there was about 200GB in it.
> >
> > There were 2 sets of files (<id1>, <id1>.1 .. <id1>.99, and the same for
> > id2).
>
> Can you show the actual dir listing?
>
> > Tried the various options from
> > https://blog.2ndquadrant.com/postgresql-filename-to-table/ and oid2name
> > (with -i), to trace it back to a table but all came up empty.
> >
> > Now this folder has a bit of a history spanning several postgres
> > versions and upgrades, and sometime in the past one of the upgrades went
> > horribly wrong, so my first thought was that this was possibly some
> > leftovers from that mishap, but the filetimes were a bit later than that.
> > Also hard to tell because those tables are used as write-once, read-alot
> > so could not base the last usage on filedate.
> >
> > Normally I probably would dare to risk deleting those files, but after
> > the dropping and truncating, the 2 files without extension had the time
> > of drop/truncate and were 0 bytes in length (unfortunately I didn't
> > check the filesize before drop/truncating).
> >
> > Are there other options to see if these files are leftovers from
> > previous stuff and not used by postgres (so i can safely delete them)?
> >
> > Postgres 11, just one used database on it (the other one being a postgis
> > template), running on windows server 2012.
> >
> > In replies please use reply to all...
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Safe to delete files?
@ 2019-04-13 14:24  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Paul van der Linden <paul.doskabouter@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2019-04-13 14:24 UTC (permalink / raw)
  To: Paul van der Linden <paul.doskabouter@gmail.com>; +Cc: pgsql-general; ronljohnsonjr@gmail.com

On 4/13/19 7:10 AM, Paul van der Linden wrote:
> It was just 99 files of 1GB each for each id, and no I didn't vacuum.
> I did see disk usage dropping quite a lot after dropping those tables 
> though, so I expected postgres to delete all unneccesary files for all 
> the tables.
> 
> However when checking just now I saw that the files I was referring to 
> were indeed deleted somehow (don't have an autovacuum running).
> So not sure how or why, but my problem is solved

Did you DROP the tables in a transaction and look at the the directory 
previously before you issued COMMIT?


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Safe to delete files?
@ 2019-04-13 14:54  Paul van der Linden <paul.doskabouter@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Paul van der Linden @ 2019-04-13 14:54 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: pgsql-general; ronljohnsonjr@gmail.com

I did it in pgadmin, without begin commit.


On Sat, Apr 13, 2019 at 4:24 PM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

> On 4/13/19 7:10 AM, Paul van der Linden wrote:
> > It was just 99 files of 1GB each for each id, and no I didn't vacuum.
> > I did see disk usage dropping quite a lot after dropping those tables
> > though, so I expected postgres to delete all unneccesary files for all
> > the tables.
> >
> > However when checking just now I saw that the files I was referring to
> > were indeed deleted somehow (don't have an autovacuum running).
> > So not sure how or why, but my problem is solved
>
> Did you DROP the tables in a transaction and look at the the directory
> previously before you issued COMMIT?
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2019-04-13 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-12 20:11 Safe to delete files? Paul van der Linden <paul.doskabouter@gmail.com>
2019-04-13 00:06 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-04-13 14:10   ` Paul van der Linden <paul.doskabouter@gmail.com>
2019-04-13 14:24     ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-04-13 14:54       ` Paul van der Linden <paul.doskabouter@gmail.com>
2019-04-13 00:09 ` Ron <ronljohnsonjr@gmail.com>

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