diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c new file mode 100644 index 21d52e0..62afbe4 *** a/src/backend/commands/foreigncmds.c --- b/src/backend/commands/foreigncmds.c *************** *** 40,46 **** /* * Convert a DefElem list to the text array format that is used in * pg_foreign_data_wrapper, pg_foreign_server, and pg_user_mapping. ! * Returns the array in the form of a Datum, or PointerGetDatum(NULL) * if the list is empty. * * Note: The array is usually stored to database without further --- 40,46 ---- /* * Convert a DefElem list to the text array format that is used in * pg_foreign_data_wrapper, pg_foreign_server, and pg_user_mapping. ! * Returns the array in the form of a Datum, an empty array * if the list is empty. * * Note: The array is usually stored to database without further *************** optionListToArray(List *options) *** 74,80 **** if (astate) return makeArrayResult(astate, CurrentMemoryContext); ! return PointerGetDatum(NULL); } --- 74,80 ---- if (astate) return makeArrayResult(astate, CurrentMemoryContext); ! return construct_empty_array(TEXTOID); } *************** transformGenericOptions(Oid catalogId, *** 165,171 **** result = optionListToArray(resultOptions); ! if (OidIsValid(fdwvalidator) && DatumGetPointer(result) != NULL) OidFunctionCall2(fdwvalidator, result, ObjectIdGetDatum(catalogId)); return result; --- 165,171 ---- result = optionListToArray(resultOptions); ! if (OidIsValid(fdwvalidator)) OidFunctionCall2(fdwvalidator, result, ObjectIdGetDatum(catalogId)); return result;