4

Where do I set the "Cost Estimation Options" for postgres_fdw. Specifically I want to add use_remote_estimate.

test=# SET use_remote_estimate=true;
ERROR:  unrecognized configuration parameter "use_remote_estimate"
Evan Carroll
  • 65,432
  • 50
  • 254
  • 507

1 Answers1

9

postgres_fdw doesn't use GUC variables. The settings for postgres_fdw are actually set with options under CREATE SERVER,

CREATE SERVER [IF NOT EXISTS] server_name [ TYPE 'server_type' ] [ VERSION 'server_version' ]
    FOREIGN DATA WRAPPER fdw_name
    [ OPTIONS ( option 'value' [, ... ] ) ];

Or with ALTER SERVER

Change options for the server. ADD, SET, and DROP specify the action to be performed. ADD is assumed if no operation is explicitly specified. Option names must be unique; names and values are also validated using the server's foreign-data wrapper library.

Like,

-- Set it if it's never been set
ALTER SERVER flybase
  OPTIONS (ADD use_remote_estimate 'true');

-- Change it if it has been set
ALTER SERVER flybase
  OPTIONS (SET use_remote_estimate 'false');

-- Drop it if it has never been set
ALTER SERVER flybase
  OPTIONS (DROP use_remote_estimate);
Evan Carroll
  • 65,432
  • 50
  • 254
  • 507