Fujii Masao <masao(dot)fujii(at)gmail(dot)com> writes:
> What I'm worried about is the case where a tablespace is created
> under the $PGDATA directory.
What would be the sense of that? If you're concerned about whether the
code handles it correctly, maybe the right solution is to add code to
CREATE TABLESPACE to disallow it.
regards, tom lane