2

if i set random_page_cost = 1.1 in my postgresql.conf, it is not beeing set, not after restart, not after select pg_reload_conf();.
It is however set, if i put it in the configfile bevor creating a new cluster.

If i update it via ALTER SYSTEM SET random_page_cost = 1.1; select pg_reload_conf();, it is set correctly.

Can someone please guide me to how to find out, WHY?

(I already started with -d 5, hoping i find something interesting in the startup-logs, why the value is beeing ignored, but i found nothing.

Thanks in advance.

Regards,
Stefan

New contributor
swe is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

3

Parameters can be set on many levels that override a setting in postgresql.conf:

  • with ALTER SYSTEM
  • during server start
  • on the database
  • on the user
  • with SET or SET LOCAL

To determine what overrides the value from postgresql.conf, run

SELECT source, sourcefile, sourceline
FROM pg_settings
WHERE name = 'random_page_cost';

You can undo a setting from ALTER SYSTEM with

ALTER SYSTEM RESET random_page_cost;

Settings on the database or user can be undone with ALTER DATABASE/ROLE ... RESET ....

Once you have undone all overriding settings, the setting from postgresql.conf will prevail.

2
  • 1
    Tanks a lot. I did not know how to reset the value correctly and so my tests were a complete mess...
    – swe
    Commented 18 hours ago
  • You can also use the pg_file_settings view to understand which configuration settings in PostgreSQL's configuration files override others.
    – Sahap Asci
    Commented 3 hours ago

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.