PostgreSQL Configuration Files --PostgreSQ配置文件

Three main configuration files control basic operations of a Postgresql server instance.

These files are all located in the default Postgresql data folder. You can edit them

using your text editor of choice,or using the admin pack that comes with pgAdmin.

  • postgresql.conf controls general settings,such as how much memory to allocate,

    default storage location for new databases,which IPs Postgresql listens on,where

    logs are stored,and so forth.

  • pg_hba.conf controls security. It manages access to the server,dictating which users

    can login into which databases,which IPs or groups of IPs are permitted to connect

    and the authentication scheme expected.

  • pg_ident.conf is the mapping file that maps an authenticated OS login to a Post-

    gresql user. This file is used less often,but allows you to map a server account to

    a Postgresql account. For example,people sometimes map the OS root account

    to the postgre’s super user account. Each authentication line in pg_hba.conf can

    use a different pg_ident.conf file.


    If you are ever unsure where these files are located,

run the Example 2-1 query as a super user while connected to any of your databases.

select * from pg_settings

where category = 'File Locations'

"config_file";"/var/lib/pgsql/data/postgresql.conf"

"data_directory";"/var/lib/pgsql/data"

"external_pid_file";""

"hba_file";"/var/lib/pgsql/data/pg_hba.conf"

"ident_file";"/var/lib/pgsql/data/pg_ident.conf"


也可以用linux文件查找命令查找:

[root@localhost ~]# find / -name postgresql.conf

/usr/lib/tmpfiles.d/postgresql.conf

/var/lib/pgsql/data/postgresql.conf

或者:

[root@localhost ~]# locate postgresql.conf

/usr/lib/tmpfiles.d/postgresql.conf

/usr/pgsql-9.4/share/postgresql.conf.sample

/usr/share/pgsql/postgresql.conf.sample

/var/lib/pgsql/data/postgresql.conf

相关文章

项目需要,有个数据需要导入,拿到手一开始以为是mysql,结果...
本文小编为大家详细介绍“怎么查看PostgreSQL数据库中所有表...
错误现象问题原因这是在远程连接时pg_hba.conf文件没有配置正...
因本地资源有限,在公共测试环境搭建了PGsql环境,从数据库本...
wamp 环境 这个提示就是说你的版本低于10了。 先打印ph...
psycopg2.OperationalError: SSL SYSCALL error: EOF detect...