Re: Deleting a table file does not raise an error when the table is touched afterwards, why? - Mailing list pgsql-general

From Tom Lane
Subject Re: Deleting a table file does not raise an error when the table is touched afterwards, why?
Date
Msg-id 12309.1464625657@sss.pgh.pa.us
Whole thread Raw
In response to Deleting a table file does not raise an error when the table is touched afterwards, why?  (Daniel Westermann <daniel.westermann@dbi-services.com>)
List pgsql-general
Daniel Westermann <daniel.westermann@dbi-services.com> writes:
> Then I delete the file:
> postgres@pg_essentials_p1:/u02/pgdata/PG1/base/16422/ [PG1] rm 32809

There's a reason why the database directory is not readable/writable
by unprivileged users: it's to prevent them from doing dumb things
like that.  People who do have write access on the database are
assumed to know better.

> Wouldn't it be much more safe to raise an error as soon as the table is touched?

Well, yes, but it would impose huge amounts of overhead in order to
raise an error a bit sooner for a stupid user action.  The ideal
thing would be to prevent users from breaking their database in the
first place --- but there's not much we can do in that direction
beyond setting the directory permissions.

            regards, tom lane


pgsql-general by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pglogical
Next
From: Alex Ignatov
Date:
Subject: Re: Deleting a table file does not raise an error when the table is touched afterwards, why?