* Add PGDLLEXPORT to functions called externally
* Make it compile with Visual Studio (it doesn't support #ifdef in macros)
* Add explicit type-cast so silence compiler warnings.
* Replace {INT_MAX | INT32_MAX } with PG_INT32_MAX
This is the easy part: get rid of the features added in pg11 such as
hash partitioning or default partition, and adapt the required imports.
There are still a lot of errors due to the lack of PartitionScheme and
many fields in RelOptInfo in pg10.
Previous naive implementation was storing the hypothetical partitions in
a simple List, which would definitely not scale if many hypothetical
partitions are stored.
The partition's children oid are also now maintained in each hypoTable
entry, for performance reason too.
Some minor fixup too while at it.
Register a relcache callback, filter the relid list to keep only the one
corresponding to table that are hypothetically partitioned and
asynchronously process them. We only care about table being dropped, so
in order to detect that we check if the relid we stored still correspond
to a table whose name is the same as the one we recorded when creating
the hypothetical objects.
The hypothetical statistics are stored in a hashtable in backend private
memory. They're injected with the standard get_relation_stats_hook
hook given a (relid, attnum).
Now, we also compute the expected size and cardinality of partitions for list
and range partitioning for each partition during get_relation_info_hook
(in hypo_injectHypotheticalPartitioning()) instead of doing it in
set_rel_pathlist_hook. This hook is now not needed anymore, so remove
it and all underlying functions.
While at it, also remove now useless function imported in hypopg_import,
remove useless includes and fix compile with pg10- versions.