1

I would like to change the default value for the option fdw_startup_cost for an existing postgres_fdw server but am getting an error message stating that option fdw_startup_cost is not found, even though its an option according to the documentation (https://www.postgresql.org/docs/12/postgres-fdw.html).

I'm using version 12.8 of PostgreSQL and the code used to set up the server is as follows:

CREATE EXTENSION postgres_fdw;

CREATE SERVER my_server_name
  FOREIGN DATA WRAPPER postgres_fdw
  OPTIONS (host 'myhost.whatever.com', dbname 'my_database_name', fetch_size '50000', use_remote_estimate 'true');

Command I'm using to change the settings is:

ALTER SERVER prd_rtl_fdw OPTIONS (SET fdw_startup_cost '1000000000000000');

The error message is:

An error occurred when executing the SQL command:
ALTER SERVER prd_rtl_fdw OPTIONS (SET fdw_startup_cost '1000000000000000')

ERROR: option "fdw_startup_cost" not found
1 statement failed.

If I create a new server I can use this option (and it is applied successfully):

CREATE SERVER my_new_server_name
  FOREIGN DATA WRAPPER postgres_fdw
  OPTIONS (host 'myhost.whatever.com', dbname 'my_database_name', 
  fetch_size '50000', use_remote_estimate 'true', fdw_startup_cost '1000000000000000');

but creating a new server is not really an option unfortunately for operational reasons.

Any assistance would be greatly appreciated!

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Steve
  • 11
  • 1

1 Answers1

0

Your statement would be correct if the option were already set and you want to change the value. But since the option is not set yet, you need to use

ALTER SERVER prd_rtl_fdw OPTIONS (ADD fdw_startup_cost '1000000000000000');
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263