Hello,
While I was thinking of application binary compatibility between PostgreSQL releases, some questions arose about C
languageuser-defined functions (UDFs) and extensions that depend on them.
[Q1]
Can the same UDF binary be used with different PostgreSQL minor releases? If it is, is it a defined policy (e.g.
writtensomewhere in the manual, wiki, documentation in the source code)?
For example, suppose you build a UDF X (some_extension.so/dll) with PostgreSQL 9.5.0. Can I use the binary with
PostgreSQL9.5.x without rebuilding?
Here, the UDF references the contents of server-side data structures, like pgstattuple accesses the members of
HeapScanData. If some bug fix of PostgreSQL changes the member layout of those structures, the UDF binary would
possiblymisbehave. Basically, should all UDFs be rebuilt with the new minor release? Or, are PostgreSQL developers
awareof such incompatibility and careful not to change data structure layout?
[Q2]
Can the same UDF binary be used with different PostgreSQL distributions (EnterpriseDB, OpenSCG, RHEL packages, etc.)?
Orshould the UDF be built with the target distribution?
I guess the rebuild is necessary if the distribution modified the source code of PostgreSQL. That is, the UDF binary
builtwith the bare PostgreSQL cannot be used with EnterpriseDB's advanced edition, which may modify various data
structures.
How about other distributions which probably don't modify the source code? Should the UDF be built with the target
PostgreSQLbecause configure options may differ, which affects data structures?
Regards
Takayuki Tsunakawa