简体   繁体   English

如何在Heroku上访问Postgresql部署的postgresql.conf文件

[英]How to access postgresql.conf file of postgresql deployment on Heroku

I have a Django app hosted on Heroku, with a postgresql DB, on a Standard 0 plan. 我在Heroku上托管了一个Django应用,并带有一个Standard 0计划的PostgreSQL数据库。 I want to access and read the postgresql.conf file for this particular app (to ascertain/edit the settings). 我想访问并阅读此特定应用程序的postgresql.conf文件(以确定/编辑设置)。 Can anyone guide me how to do that? 谁能指导我该怎么做?

Note: I can't do that via the Heroku dashboard, and I don't know how to access the app's file structure over the Ubuntu commandline. 注意:我无法通过Heroku仪表板执行此操作,并且我不知道如何通过Ubuntu命令行访问应用程序的文件结构。

You can list all current settings without an access to postgres.conf : 您可以列出所有当前设置,而无需访问postgres.conf

SELECT name, current_setting(name)
FROM pg_settings;

          name           |    current_setting    
-------------------------+-----------------------
 allow_system_table_mods | off
 application_name        | psql.bin
 archive_command         | (disabled)
 archive_mode            | off
 archive_timeout         | 0
...

You can also check which parameters are set in postgres.conf to values other than default: 您还可以检查在postgres.conf中将哪些参数设置为默认值以外的值:

SELECT name, current_setting(name), sourcefile, sourceline
FROM pg_settings
WHERE sourcefile notnull;

            name            |  current_setting  |               sourcefile               | sourceline 
----------------------------+-------------------+----------------------------------------+------------
 DateStyle                  | ISO, DMY          | /opt/postgres/9.5/data/postgresql.conf |        538
 default_text_search_config | pg_catalog.simple | /opt/postgres/9.5/data/postgresql.conf |        560
 dynamic_shared_memory_type | posix             | /opt/postgres/9.5/data/postgresql.conf |        130
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM