HV002
Read PG 18 manual ↗fdw_dynamic_parameter_value_needed
- SQLSTATE
- HV002
- Condition name
- fdw_dynamic_parameter_value_needed
- Class
- Foreign Data Wrapper Error (SQL/MED)
- Source macro
- ERRCODE_FDW_DYNAMIC_PARAMETER_VALUE_NEEDED
- Evidence
- Source path confirmed
English SQLSTATE atlas: authored explanations and source/runtime evidence are separate from the manual definitions. View source ↗
At a glance
HV002 says that an FDW operation needs a parameter value that was not available. PostgreSQL 18.6's bundled file_fdw validator raises it during foreign-table option validation when neither filename nor program is supplied.
Meaning and trigger paths
In contrib/file_fdw/file_fdw.c, the validator checks ForeignTableRelationId options and raises ERROR with either filename or program is required for file_fdw foreign tables when both values are absent. The condition name is broader than this one implementation: another FDW may need a value at planning, scan, or modify time and report a different message.
Messages and diagnostics
The fixed 18.6 variant is ERROR: either filename or program is required for file_fdw foreign tables from file_fdw_validator, lines 345-350. The fixed 9.1.24 source uses ERROR: filename is required for file_fdw foreign tables; neither source template adds a detail or hint. These are local option-validation errors; they do not mean a remote program failed to start.
Diagnosis
Inspect the exact CREATE FOREIGN TABLE or ALTER FOREIGN TABLE ... OPTIONS definition and the wrapper's accepted option names. For file_fdw, check that exactly one usable source option is present and that its value is visible to the server process. For another wrapper, locate its validator or callback and read its own required-parameter contract.
Response
Add the required FDW option with the correct spelling and permissions, or use the wrapper's supported dynamic parameter mechanism. Re-run validation or the original operation after checking the foreign server and table identity. Retrying unchanged SQL cannot provide a missing value and is not a recovery strategy.
Versions
HV002 is observed from 9.1.0 through 18.6 and the 19 Beta 3 preview. The fixed 9.1.24 file_fdw source uses “filename is required”, while the fixed 18.6 source uses “either filename or program is required”; use the server version when matching the message. This does not claim the exact release where the wording changed.
Sources
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.file_fdw.c— validator condition and message.- Historical
file_fdw.c9.1.24 — fixed filename-only validator message, SHA-2566f948ed8f9ffa6d1077b289f23c53eff02c5182492f0827b908c2be86026dad8. - Structured evidence — source path and historical message boundary.
Source evidence
Evidence belongs to the frozen source and runtime versions listed here. It is not a runtime verification of the selected manual version.
HV002 is fdw_dynamic_parameter_value_needed in Class HV.
Method: Read the fixed definition row.
file_fdw raises HV002 when neither filename nor program is supplied for a foreign table.
Method: Read file_fdw.c:345-350.
Limits: This is one bundled implementation; other wrappers can use the condition for different required parameters.
The fixed 18.6 file_fdw source uses the filename-or-program message, while the fixed 9.1.24 source uses the filename-only wording.
Method: Read both fixed wrapper source files and compare the validator report templates.
Limits: These are two fixed wrapper snapshots; this does not claim the exact transition release or behavior of other wrappers.
- src/backend/utils/errcodes.txt · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - contrib/file_fdw/file_fdw.c · REL_18_6 ·
724edf9bde9d356724ad384a2e196edc3c9f80f7 - contrib/file_fdw/file_fdw.c · REL9_1_24 ·
e85493559c4678f54d30b6b4e04b17c03a3192d7 raw/calls/REL_18_6.jsonl· ·
Message templates
ERROR · contrib/file_fdw/file_fdw.c:349-350
Primary
either filename or program is required for file_fdw foreign tables
ERROR · contrib/file_fdw/file_fdw.c:222-224
Primary
filename is required for file_fdw foreign tables
Reproduction & repair cases
No reproduction case is attached to this condition.
Recorded runtime evidence
No runtime observation is attached to this entry.
Version history 1
- PG 9.0 → 9.1added
Definition snapshot: english-manuals:cdc07157c5f997427d259279bea… · English manual source