Is a UDF binary portable across different minor releases and PostgreSQL distributions? - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject Is a UDF binary portable across different minor releases and PostgreSQL distributions?
Date
Msg-id 0A3221C70F24FB45833433255569204D1F59C7E4@G01JPEXMBYT05
Whole thread Raw
Responses Re: Is a UDF binary portable across different minor releases and PostgreSQL distributions?  (Michael Paquier <michael.paquier@gmail.com>)
Re: Is a UDF binary portable across different minor releases and PostgreSQL distributions?  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
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





pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: OpenSSL 1.1 breaks configure and more
Next
From: Michael Paquier
Date:
Subject: Re: primary_conninfo missing from pg_stat_wal_receiver