Prepare HAF upgrade procedure
There is needed support for easy upgrade of HAF instance to newer version. There are 2 problems to solve:
- hard upgrade - in case when table data structures changed. Probably, because of performance reasons, it will be much easier to replay given HAF instance from scratch (usually alter table statements are slow, for the other side rewriting a table to a copy having new scheme and final rename will require a lot of space (i.e. x2))
- soft upgrade when only definitions of hfm extension functions changed, and extension should be reinstalled in database.
Upgrade is complicated because of wrong hfm.so naming scheme (including its revision in a name), what forces on each change to rebuild definitions of SQL functions defined in extension. Probably better is to add dedicated get_version function, returning compiled-in version. This way all soft upgrades covering just code updates will be done seamlessly.
Final solution is adding support for ALTER EXTENSION UPDATE
construct (an upgrade script) which can take care for every kind of upgrade.