How to access postgresql.conf file of postgresql deployment on Heroku

浪尽此生 提交于 2021-02-19 05:59:46

问题


I have a Django app hosted on Heroku, with a postgresql DB, on a Standard 0 plan. I want to access and read the postgresql.conf file for this particular app (to ascertain/edit the settings). 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.


回答1:


You can list all current settings without an access to 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:

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
...


来源:https://stackoverflow.com/questions/33915865/how-to-access-postgresql-conf-file-of-postgresql-deployment-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!