Re: Migrating a Database to a new tablespace - Mailing list pgsql-sql

From Markus Schaber
Subject Re: Migrating a Database to a new tablespace
Date
Msg-id 44508A44.4090909@logix-tt.com
Whole thread Raw
In response to Re: Migrating a Database to a new tablespace  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Migrating a Database to a new tablespace  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi, Bruce,

Bruce Momjian wrote:

> I have work someone did in the past.  I just need to be updated to deal
> with tablespaces.
> 
>     ftp://candle.pha.pa.us/pub/postgresql/mypatches/checkfile.*
> 
> Let me know if you want details.

It looks nice, but I would not like automatic deletion (or only optional
or configurable), there might be valid reasons for "alien" files to
exist. (README files for admins to communicate what this directory is
used for, MacOS ressource forks, Reiser4 special files etc...)

What about putting the identification code in a set returning function
or view that can be called by the admin. Then tools like nagios can call
it and ring the alarm bells when unknown files appear, or possibly
autovacuum calls it once on each session to generate log warnings.

Btw, are CLUSTER and ALTER TABLE ALTER COLUMN statements that "create or
drop a relation" in this sense? And what is with tables getting extended
to more than one file?


Another idea would be to first create and sync log entries about the
files to be created / deleted, and then actually create / delete the
files. So on log replay, the backend could watch out for file operations
from transactions that never completed. It will slow those operations
down, but such file operations are both seldom and relatively expensive
on most filesystems. And it does not help in case of fsync=off, but
those admins already take worse risks than wasting disk space.

Thanks,
Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org


pgsql-sql by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Migrating a Database to a new tablespace
Next
From: "Penchalaiah P."
Date:
Subject: any one can help me how to get multiple rows in postgresql using arrays in functions