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