HV00J
PostgreSQLERRORNotableForeign Data Wrapper ErrorHIGH confidence

fdw_option_name_not_found

What this means

The specified FDW option name was not found when attempting to modify or remove it, typically via ALTER SERVER DROP OPTION or similar.

Why it happens
  1. 1Attempting to DROP an option that was never SET on the server/mapping/table
  2. 2Option name is misspelled in the DROP OPTION clause
  3. 3Option was already removed in a prior ALTER statement
How to reproduce

ALTER SERVER, ALTER USER MAPPING, ALTER FOREIGN TABLE with DROP OPTION

trigger — this will error
trigger — this will error
ALTER SERVER myserver OPTIONS (DROP port);

expected output

ERROR:  HV00J: fdw_option_name_not_found

Fix

Verify existing options before dropping

WHEN Not sure which options are currently set

Verify existing options before dropping
SELECT srvoptions FROM pg_foreign_server WHERE srvname = 'myserver';

Why this works

Only DROP options that are currently present in the options array

What not to do

Do not blindly DROP options without checking they exist

Results in this error if the option is absent

Sources
Official documentation ↗

https://www.postgresql.org/docs/current/errcodes-appendix.html

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All PostgreSQL errors