1

I have PostgreSQL 14 server running on Windows 10. I have read here that the default value for the shared_buffer parameter is low and increasing it can improve performance for some jobs. However, it appears that the shared_buffer parameter cannot be increased if the server (or database?) has already been created.

So, my question is: at what point in the setup process can I increase the value of this parameter on my machine?

jtam
  • 814
  • 1
  • 8
  • 24
  • 1
    Changing it just requires you to restart the database (thus momentarily severing all existing connections), not recreate it. – jjanes Sep 07 '22 at 16:53

2 Answers2

3

Changing shared_buffers does not require setting up a new database cluster.

Specifically, the manual says:

This parameter can only be set at server start

In Windows terms, it means that any new values are applied at the time the Postgres Service starts.

You should be able to change the value in postgresql.conf (which is usually located at C:\Program Files\PostgreSQL\<version_number>\data\postgresql.conf) and then restart the Postgres service

Since you're using v. 14, you may also opt to use ALTER SYSTEM instead of fiddling with postgresql.conf:

ALTER SYSTEM SET shared_buffers TO <your_value>;

And then restart the service

Frank Heikens
  • 117,544
  • 24
  • 142
  • 135
richyen
  • 8,114
  • 4
  • 13
  • 28
1

that is not what the manual of postgres says,

It only states, after increasing or decreasing the value , you need to restart the server, because it allocates the new memory size while starting.

see manual

nbk
  • 45,398
  • 8
  • 30
  • 47