问题
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