createas.c and matview.c contain corresponding functions that are
defined in the same name files in the core version. pg_ivm.c contains
user interface functions and callback functions.
The file names are identical to those in the core code ( in pgsql-ivm
repository) and some codes are copied from it so that we can easily
compare the code between the extension and the core. That is because
we would like to apply features in this extension to the core as a new
feature in future. Also, we plan to adopt the core code change to the
extension to prevent the difference from being too far. However,
considering modularity or code-readability, it is possible that we may change this policy in future.
In passing, Makefile is also fixed and we don't need to use
USE_PGXS now.
This currently crashes the server: `SELECT create_immv(NULL, 'SELECT * FROM test');` . Marking the function STRICT will avoid calling it with NULL arguments.
Alternative would be check for NULLs in create_immv.