pg_ctl程序命令启动PostgreSQL服务时候,报错提示:
FATAL: data directory “/xxx/xxx” has wrong ownership
HINT: The server must be started by the user that owns the data directory.
我们在PostgreSQL教程系列中讲解过,PostgreSQL服务器启动时候会对PGDATA数据库族目录进行校验操作。若不存在,则报错;若目录存在,则会对该目录的属性(比如该目录的用户id等)进行逻辑判断操作,如下代码所示:
#if !defined(WIN32)