Peter Eisentraut wrote:
> Now the way I read the FDWs you provide (default and pgsql), you are
> creating your own API for initialization and options validation that is
> not in the standard. That would appear to contradict the idea of a
> standard interface. I understand that option validation is useful, and
> I don't see anything about it in the standard, but should we break the
> API like that? What are your designs about this?
>
Hmm, in that perspective it would make sense to make the InitializeFdw
function optional (it was, before I got worried about library reloads).
If no InitializeFdw is present, connection lookup and option validation
are disabled. All of the standard defined FDW functions are fetched by
load_external_function. This way we could have the additional features
and still be able to load standard conforming FDW's.
Actually it would make sense to use _PG_init instead of InitializeFdw.
This way it'd be called automatically on library load, the parameter(s)
would be passed in globals though.
regards,
Martin