sql - postgres 的数据文件夹的权限应该是什么

标签 sql postgresql postgresql-9.1

<分区>

我的 postgres 正在使用这个 hba 文件

/var/lib/pgsql/9.1/data/pg_hba.conf

但是我不能进入/var/lib/pgsql/9.1/data 文件夹,它说权限被拒绝,这些是所有文件的权限

total 92
drwx------ 19 postgres postgres  4096 Jan 27 15:05 base
drwx------  2 postgres postgres  4096 Jan 27 22:42 global
drwx------  2 postgres postgres  4096 Apr 25  2013 pg_clog
-rw-------  1 postgres postgres  4377 Jan 27 22:57 pg_hba.conf
-rw-------  1 postgres postgres  1636 Apr 25  2013 pg_ident.conf
drwx------  2 postgres postgres  4096 May  2  2013 pg_log
drwx------  4 postgres postgres  4096 Apr 25  2013 pg_multixact
drwx------  2 postgres postgres  4096 Jan 27 17:34 pg_notify
drwx------  2 postgres postgres  4096 Apr 25  2013 pg_serial
drwx------  2 postgres postgres  4096 Jan 27 23:01 pg_stat_tmp
drwx------  2 postgres postgres  4096 Apr 25  2013 pg_subtrans
drwx------  2 postgres postgres  4096 Apr 25  2013 pg_tblspc
drwx------  2 postgres postgres  4096 Apr 25  2013 pg_twophase
-rw-------  1 postgres postgres     4 Apr 25  2013 PG_VERSION
drwx------  3 postgres postgres  4096 Jan 27 15:05 pg_xlog
-rw-------  1 postgres postgres 19136 Apr 27  2013 postgresql.conf
-rw-------  1 postgres postgres    71 Jan 27 17:34 postmaster.opts
-rw-------  1 postgres postgres    72 Jan 27 17:34 postmaster.pid

我想知道这样可以吗。或者我需要改变它们

我正在尝试重新启动

sudo service postgresql start
Starting postgresql service:                               [FAILED]

我想看看失败的原因,但不知道日志文件在哪里

最佳答案

您应该能够以 root 身份进入该文件夹。这是关于手头可能是什么问题的暗中刺探——您是否运行了 initdb -D/var/lib/pgsql/9.1/data

为了回答您的问题,日志文件位置在/var/lib/pgsql/9.1/data/postgresql.conf 中给出——log_directory 和 log_filename,这些仅在 logging_collector 开启时使用。

关于sql - postgres 的数据文件夹的权限应该是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21384434/

相关文章:

ruby-on-rails - 返回没有特定键的记录 - Rails4 HStore Postgresql 查询

postgresql - 在 UTF-8 PostgreSQL 数据库中指定 ASCII 列

SQLite3 性能与 BETWEEN 范围的 OR

sql - 在Hive上使用索引

python - 即使启动它的 lambda 函数超时,如何使复制命令继续在 Redshift 中运行?

postgresql - 如何过滤 JSONB 列表

python - Django 两个多域一关联表

c# - 从 C# 代码调用时查询抛出异常

mysql - SQL:返回具有给定项目值子集的项目的查询

postgresql - 有没有办法用不同的 id 多次将同一行添加到 postgresql 的表中?